{
  "openapi": "3.1.0",
  "info": {
    "title": "AtomicPlayer API",
    "version": "1.0.0",
    "description": "Video hosting, player configuration, analytics, and webhooks for AtomicPlayer. Every response uses success, data, and error."
  },
  "servers": [
    {
      "url": "https://api.atomicplayer.ai"
    }
  ],
  "tags": [
    {
      "name": "Videos",
      "description": "Create videos, request an upload URL, and read processing status."
    },
    {
      "name": "Folders",
      "description": "Organize videos into folders."
    },
    {
      "name": "Tags",
      "description": "Label videos and replace the tags on one video."
    },
    {
      "name": "Player",
      "description": "Read, draft, and publish player configuration."
    },
    {
      "name": "Analytics",
      "description": "Workspace playback, retention, audience, and revenue reports."
    },
    {
      "name": "Webhooks",
      "description": "Subscribe a public HTTPS URL to signed account events."
    },
    {
      "name": "API keys",
      "description": "Create and revoke keys. These routes use a dashboard session, not an API key."
    }
  ],
  "paths": {
    "/v1/videos": {
      "get": {
        "tags": [
          "Videos"
        ],
        "summary": "List videos",
        "description": "Returns the videos in a workspace. Pass tagId to keep one tag. Required scope: `read`.",
        "operationId": "get_v1_videos",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Workspace id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tagId",
            "in": "query",
            "required": false,
            "description": "Only videos with this tag.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List videos",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      },
      "post": {
        "tags": [
          "Videos"
        ],
        "summary": "Create a video",
        "description": "Creates a video record. The file is uploaded separately with the upload URL. Required scope: `write`.",
        "operationId": "post_v1_videos",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Create a video",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "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": "Get a video",
        "description": "Returns one video, including playback URLs once it is ready. Required scope: `read`.",
        "operationId": "get_v1_videos__videoId_",
        "parameters": [
          {
            "name": "videoId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "videoId"
          }
        ],
        "responses": {
          "200": {
            "description": "Get a video",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Videos"
        ],
        "summary": "Update a video",
        "description": "Changes fields such as the title or folder. Required scope: `write`.",
        "operationId": "patch_v1_videos__videoId_",
        "parameters": [
          {
            "name": "videoId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "videoId"
          }
        ],
        "responses": {
          "200": {
            "description": "Update a video",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "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": "Delete a video",
        "description": "Deletes the video from the workspace. Required scope: `write`.",
        "operationId": "delete_v1_videos__videoId_",
        "parameters": [
          {
            "name": "videoId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "videoId"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete a video",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/videos/{videoId}/upload-url": {
      "post": {
        "tags": [
          "Videos"
        ],
        "summary": "Create an upload URL",
        "description": "Returns a one-time upload target. Send the file there, then poll the status route. Required scope: `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": "Create an upload URL",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/videos/{videoId}/status": {
      "get": {
        "tags": [
          "Videos"
        ],
        "summary": "Get upload status",
        "description": "status moves from uploading to processing and then ready. Required scope: `read`.",
        "operationId": "get_v1_videos__videoId__status",
        "parameters": [
          {
            "name": "videoId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "videoId"
          }
        ],
        "responses": {
          "200": {
            "description": "Get upload status",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/video-folders": {
      "get": {
        "tags": [
          "Folders"
        ],
        "summary": "List folders",
        "description": "Returns the folders in a workspace. Required scope: `read`.",
        "operationId": "get_v1_video-folders",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Workspace id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List folders",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      },
      "post": {
        "tags": [
          "Folders"
        ],
        "summary": "Create a folder",
        "description": "parentId nests the folder. Omit it for a root folder. Required scope: `write`.",
        "operationId": "post_v1_video-folders",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Create a folder",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "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": "List tags",
        "description": "Returns the tags in a workspace. Required scope: `read`.",
        "operationId": "get_v1_video-tags",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Workspace id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List tags",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      },
      "post": {
        "tags": [
          "Tags"
        ],
        "summary": "Create a tag",
        "description": "Creates a tag that can be attached to videos. Required scope: `write`.",
        "operationId": "post_v1_video-tags",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Create a tag",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "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": "Replace video tags",
        "description": "Replaces the full tag list. Send an empty array to clear the tags. Required scope: `write`.",
        "operationId": "put_v1_videos__videoId__tags",
        "parameters": [
          {
            "name": "videoId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "videoId"
          }
        ],
        "responses": {
          "200": {
            "description": "Replace video tags",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "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": "List players",
        "description": "Returns the player configs in a workspace. Required scope: `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": "List players",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/player-config/manage/{playerId}": {
      "get": {
        "tags": [
          "Player"
        ],
        "summary": "Get a player",
        "description": "Returns the draft and the published player config. Required scope: `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": "Get a player",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/player-config": {
      "post": {
        "tags": [
          "Player"
        ],
        "summary": "Create a player",
        "description": "Creates a draft player for a video. Publish it before the embed uses it. Required scope: `write`.",
        "operationId": "post_v1_player-config",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Create a player",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "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": "Update a player draft",
        "description": "Saves draft changes. The live embed keeps the published version. Required scope: `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": "Update a player draft",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "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": "Publish a player",
        "description": "Copies the draft to the live embed and increments publishedVersion. Required scope: `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": "Publish a player",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/overview": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Analytics overview",
        "description": "Totals for views, plays, retention, clicks, and revenue. Required scope: `analytics`.",
        "operationId": "get_v1_analytics_overview",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Workspace id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Reporting window. Use 7d, 30d, 90d, or today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Analytics overview",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/video-detail": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Video analytics",
        "description": "The same totals for one video. Required scope: `analytics`.",
        "operationId": "get_v1_analytics_video-detail",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Workspace id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Reporting window. Use 7d, 30d, 90d, or today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          },
          {
            "name": "videoId",
            "in": "query",
            "required": true,
            "description": "Video id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Video analytics",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/retention": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Retention curve",
        "description": "Share of viewers still watching at each point in the video. Required scope: `analytics`.",
        "operationId": "get_v1_analytics_retention",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Workspace id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Reporting window. Use 7d, 30d, 90d, or today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          },
          {
            "name": "videoId",
            "in": "query",
            "required": true,
            "description": "Video id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Retention curve",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/funnel": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Playback funnel",
        "description": "Impressions, plays, pitch, and conversions. Required scope: `analytics`.",
        "operationId": "get_v1_analytics_funnel",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Workspace id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Reporting window. Use 7d, 30d, 90d, or today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Playback funnel",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/revenue": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Revenue",
        "description": "Revenue attributed to player conversions in the window. Required scope: `analytics`.",
        "operationId": "get_v1_analytics_revenue",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Workspace id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Reporting window. Use 7d, 30d, 90d, or today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revenue",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/cohorts": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Cohorts",
        "description": "Returning viewers grouped by the week of their first view. Required scope: `analytics`.",
        "operationId": "get_v1_analytics_cohorts",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Workspace id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Reporting window. Use 7d, 30d, 90d, or today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cohorts",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/audience": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Audience",
        "description": "Views broken down by device, country, and referrer. Required scope: `analytics`.",
        "operationId": "get_v1_analytics_audience",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Workspace id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Reporting window. Use 7d, 30d, 90d, or today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Audience",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/live": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Live viewers",
        "description": "Viewers watching right now. Required scope: `analytics`.",
        "operationId": "get_v1_analytics_live",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Workspace id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Live viewers",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/replays": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Replay sessions",
        "description": "Recent playback sessions that can be replayed. Required scope: `analytics`.",
        "operationId": "get_v1_analytics_replays",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Workspace id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Reporting window. Use 7d, 30d, 90d, or today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Replay sessions",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/analytics/video-summaries": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Video summaries",
        "description": "One summary row per video in the window. Required scope: `analytics`.",
        "operationId": "get_v1_analytics_video-summaries",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Workspace id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Reporting window. Use 7d, 30d, 90d, or today.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "today"
              ],
              "default": "30d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Video summaries",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/webhooks/events": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhook events",
        "description": "The event names a subscription can include. Required scope: `webhooks`.",
        "operationId": "get_v1_webhooks_events",
        "parameters": [],
        "responses": {
          "200": {
            "description": "List webhook events",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhooks",
        "description": "Returns the endpoints in a workspace. Secrets are not included. Required scope: `webhooks`.",
        "operationId": "get_v1_webhooks",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Workspace id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List 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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Create a webhook",
        "description": "events is a list of catalog names, or [\"*\"] for every event. The signing secret is returned once. Required scope: `webhooks`.",
        "operationId": "post_v1_webhooks",
        "parameters": [],
        "responses": {
          "201": {
            "description": "Create a 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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "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": "Get a webhook",
        "description": "Returns one endpoint without its secret. Required scope: `webhooks`.",
        "operationId": "get_v1_webhooks__id_",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Get a 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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Update a webhook",
        "description": "Changes the name, URL, events, or status. status is active or paused. Required scope: `webhooks`.",
        "operationId": "patch_v1_webhooks__id_",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Update a 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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "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": "Delete a webhook",
        "description": "Stops deliveries to this endpoint. Required scope: `webhooks`.",
        "operationId": "delete_v1_webhooks__id_",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Delete a 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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List deliveries",
        "description": "Recent delivery attempts for one endpoint. Required scope: `webhooks`.",
        "operationId": "get_v1_webhooks__id__deliveries",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "List deliveries",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/webhooks/{id}/test": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Send a test event",
        "description": "Delivers one sample event to the endpoint. Required scope: `webhooks`.",
        "operationId": "post_v1_webhooks__id__test",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Send a test event",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/webhooks/{id}/rotate-secret": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Rotate the signing secret",
        "description": "Returns a new secret once. The previous secret stops verifying. Required scope: `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": "Rotate the signing secret",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/webhooks/stats": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Webhook stats",
        "description": "Delivery health for the workspace. Required scope: `webhooks`.",
        "operationId": "get_v1_webhooks_stats",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "query",
            "required": true,
            "description": "Workspace id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook stats",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    },
    "/v1/workspaces/{workspaceId}/api-keys": {
      "get": {
        "tags": [
          "API keys"
        ],
        "summary": "List API keys",
        "description": "Uses a dashboard session. Plaintext keys are never returned again.",
        "operationId": "get_v1_workspaces__workspaceId__api-keys",
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "workspaceId"
          }
        ],
        "responses": {
          "200": {
            "description": "List API keys",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ]
      },
      "post": {
        "tags": [
          "API keys"
        ],
        "summary": "Create an API key",
        "description": "Returns the plaintext key once. It starts with 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": "Create an API key",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "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": "Update an API key",
        "description": "Changes the name or the scopes. The secret stays the same.",
        "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": "Update an API key",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "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": "Revoke an API key",
        "description": "The key stops working immediately.",
        "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": "Revoke an API key",
            "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": "A required field is missing or a value is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The bearer token is missing, invalid, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "The token is valid but does not include the required scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The record does not exist in this workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "The workspace used its monthly API allowance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key created in the dashboard. Send Authorization: Bearer apk_…"
      },
      "session": {
        "type": "http",
        "scheme": "bearer",
        "description": "Dashboard session. Used only to create and manage API keys."
      }
    },
    "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"
                }
              }
            }
          }
        }
      }
    }
  }
}
