{
  "openapi": "3.1.0",
  "info": {
    "title": "ClipMux integration API",
    "version": "1",
    "description": "The routes an app's backend, its browser uploader and its player use, and the webhooks the app receives. Requests and responses are JSON, with bodies up to 64 KiB. Every POST takes an `Idempotency-Key`. Errors are `{\"error\": {\"code\", \"message\", ...details}}`; a `429 rate_limited` carries `Retry-After`. The management API, which the dashboard uses with the owner's session, is not described here.",
    "license": {
      "name": "AGPL-3.0-only",
      "identifier": "AGPL-3.0-only"
    }
  },
  "servers": [
    {
      "url": "{public_url}",
      "variables": {
        "public_url": {
          "default": "https://video.example.com",
          "description": "The instance's public URL (CLIPMUX_URL)"
        }
      }
    }
  ],
  "paths": {
    "/v1/uploads": {
      "post": {
        "operationId": "uploads_create",
        "summary": "Create an upload",
        "tags": [
          "Uploads"
        ],
        "description": "Call from your backend, then hand the body to the browser uploader. The asset exists at once in `waiting_upload`, with its playback IDs, so you can store them before the file arrives. `generate` asks for subtitles and chapters once the video is ready; `renditions` limits the ladder.",
        "security": [
          {
            "apiKey": [
              "uploads:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUpload"
              },
              "example": {
                "size": 734003200,
                "playback_policy": "signed",
                "passthrough": "lesson_42",
                "title": "Lesson 42: Sorting",
                "generate": {
                  "subtitles": true,
                  "chapters": true
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                },
                "example": {
                  "upload_id": "upl_01jx169zxgft4kq0ydjct7r5y4",
                  "asset_id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "part_size": 33554432,
                  "part_count": 22,
                  "upload_token": "M4XQ7R2VK6WT5ZJYBNC3D4F7GH",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": true,
                      "status": "active"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "413": {
            "description": "too_large",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "too_large"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "idempotency_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "idempotency_in_progress"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "idempotency_key_reused",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "idempotency_key_reused"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/uploads/{id}/parts": {
      "post": {
        "operationId": "uploads_signParts",
        "summary": "Sign part URLs",
        "tags": [
          "Uploads"
        ],
        "security": [
          {
            "uploadToken": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartNumbers"
              },
              "example": {
                "part_numbers": [
                  1,
                  2,
                  3
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed URLs; PUT each part and keep its ETag",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignedParts"
                },
                "example": {
                  "parts": [
                    {
                      "part_number": 1,
                      "url": "https://storage.example.com/...&partNumber=1&..."
                    }
                  ],
                  "expires_at": "2026-11-18T10:30:00Z"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, upload_mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope",
                                "upload_mismatch"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "upload_not_active, upload_expired",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "upload_not_active",
                                "upload_expired"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Up to 100 part numbers at a time. PUT each part's bytes to its URL before `expires_at`, and keep the `ETag` storage returns for each."
      },
      "get": {
        "operationId": "uploads_listParts",
        "summary": "List stored parts, for resuming",
        "tags": [
          "Uploads"
        ],
        "security": [
          {
            "uploadToken": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Parts storage holds",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoredParts"
                },
                "example": {
                  "parts": [
                    {
                      "part_number": 1,
                      "etag": "\"9b2cf535f27731c974343645a3985328\"",
                      "size": 33554432
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "The parts storage already holds, so an upload can resume after a dropped connection or a closed tab."
      }
    },
    "/v1/uploads/{id}/complete": {
      "post": {
        "operationId": "uploads_complete",
        "summary": "Complete an upload",
        "tags": [
          "Uploads"
        ],
        "security": [
          {
            "uploadToken": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteUpload"
              },
              "example": {
                "parts": [
                  {
                    "part_number": 1,
                    "etag": "\"9b2cf535f27731c974343645a3985328\""
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The asset, processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Asset"
                },
                "example": {
                  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "status": "processing",
                  "version": 2,
                  "passthrough": "lesson_42",
                  "title": "Lesson 42: Sorting",
                  "base_url": "https://media.example.com",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": true,
                      "status": "active"
                    }
                  ],
                  "duration_seconds": null,
                  "tracks": [],
                  "created_at": "2026-11-18T09:30:00Z",
                  "updated_at": "2026-11-18T09:30:00Z"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, upload_mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope",
                                "upload_mismatch"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, invalid_parts",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request",
                                "invalid_parts"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "upload_not_active, upload_expired, upload_missing, size_mismatch",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "upload_not_active",
                                "upload_expired",
                                "upload_missing",
                                "size_mismatch"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Send every part's number and `ETag`. The asset moves to `processing`, and encoding starts."
      }
    },
    "/v1/uploads/{id}/cancel": {
      "post": {
        "operationId": "uploads_cancel",
        "summary": "Cancel an upload",
        "tags": [
          "Uploads"
        ],
        "security": [
          {
            "uploadToken": []
          },
          {
            "apiKey": [
              "uploads:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The asset, errored with upload_cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Asset"
                },
                "example": {
                  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "status": "errored",
                  "version": 2,
                  "passthrough": "lesson_42",
                  "title": "Lesson 42: Sorting",
                  "base_url": "https://media.example.com",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": true,
                      "status": "active"
                    }
                  ],
                  "duration_seconds": null,
                  "tracks": [],
                  "created_at": "2026-11-18T09:30:00Z",
                  "updated_at": "2026-11-18T09:30:00Z",
                  "error_code": "upload_cancelled"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Stops the upload. The asset becomes `errored` with `error_code` `upload_cancelled`. Takes the upload token or an API key with `uploads:write`."
      }
    },
    "/v1/assets": {
      "post": {
        "operationId": "assets_create",
        "summary": "Import from a URL, or attach a PC agent's local file",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "apiKey": [
              "assets:write"
            ]
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAsset"
              },
              "example": {
                "url": "https://files.example.com/lesson-42.mp4",
                "playback_policy": "signed",
                "passthrough": "lesson_42",
                "title": "Lesson 42: Sorting"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The asset, processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Asset"
                },
                "example": {
                  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "status": "processing",
                  "version": 2,
                  "passthrough": "lesson_42",
                  "title": "Lesson 42: Sorting",
                  "base_url": "https://media.example.com",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": true,
                      "status": "active"
                    }
                  ],
                  "duration_seconds": null,
                  "tracks": [],
                  "created_at": "2026-11-18T09:30:00Z",
                  "updated_at": "2026-11-18T09:30:00Z"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, import_url_refused",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request",
                                "import_url_refused"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "agent_source_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "agent_source_not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "source_unavailable, idempotency_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "source_unavailable",
                                "idempotency_in_progress"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "idempotency_key_reused",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "idempotency_key_reused"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Two ways to make an asset without an upload. With `url`, the server fetches a public http(s) URL and encodes it; a non-public or credentialed URL is `400 import_url_refused`, and a fetch that fails ends `errored` with `import_url_refused`, `import_failed` or `import_too_large`. With `agent_source_id`, it attaches a file a PC agent registered for `clipmux push --local`, and its jobs run only on that agent."
      },
      "get": {
        "operationId": "assets_list",
        "summary": "Find by passthrough, or page through changes",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "apiKey": [
              "assets:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "passthrough",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Your reference; newest first."
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Every change since this time, oldest first, deleted included."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Assets",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssetList"
                },
                "example": {
                  "data": [
                    {
                      "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                      "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                      "status": "ready",
                      "version": 4,
                      "passthrough": "lesson_42",
                      "title": "Lesson 42: Sorting",
                      "base_url": "https://media.example.com",
                      "playback_ids": [
                        {
                          "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                          "policy": "signed",
                          "playable": true,
                          "status": "active"
                        }
                      ],
                      "duration_seconds": 1830.4,
                      "tracks": [
                        {
                          "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                          "kind": "subtitles",
                          "source": "generated",
                          "status": "ready",
                          "language": "en",
                          "name": "English"
                        },
                        {
                          "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
                          "kind": "chapters",
                          "source": "generated",
                          "status": "ready"
                        }
                      ],
                      "created_at": "2026-11-18T09:30:00Z",
                      "updated_at": "2026-11-18T09:34:12Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request, invalid_cursor",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request",
                                "invalid_cursor"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "With `passthrough`, the app's assets with that reference, newest first. With `updated_since`, every change since an RFC 3339 time, oldest first, deleted assets included, up to 100 a page with `next_cursor`: the way to catch up after missed webhooks."
      }
    },
    "/v1/assets/{id}": {
      "get": {
        "operationId": "assets_get",
        "summary": "Get an asset",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "apiKey": [
              "assets:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Asset ID (ast_\u2026)."
          }
        ],
        "responses": {
          "200": {
            "description": "The asset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Asset"
                },
                "example": {
                  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "status": "ready",
                  "version": 4,
                  "passthrough": "lesson_42",
                  "title": "Lesson 42: Sorting",
                  "base_url": "https://media.example.com",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": true,
                      "status": "active"
                    }
                  ],
                  "duration_seconds": 1830.4,
                  "tracks": [
                    {
                      "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                      "kind": "subtitles",
                      "source": "generated",
                      "status": "ready",
                      "language": "en",
                      "name": "English"
                    },
                    {
                      "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
                      "kind": "chapters",
                      "source": "generated",
                      "status": "ready"
                    }
                  ],
                  "created_at": "2026-11-18T09:30:00Z",
                  "updated_at": "2026-11-18T09:34:12Z"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "The asset, as it is now. Keep the highest `version` you have seen."
      },
      "patch": {
        "operationId": "assets_update",
        "summary": "Change an asset's title",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "apiKey": [
              "assets:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Asset ID (ast_\u2026)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAsset"
              },
              "example": {
                "title": "Lesson 42: Sorting algorithms"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The asset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Asset"
                },
                "example": {
                  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "status": "ready",
                  "version": 5,
                  "passthrough": "lesson_42",
                  "title": "Lesson 42: Sorting algorithms",
                  "base_url": "https://media.example.com",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": true,
                      "status": "active"
                    }
                  ],
                  "duration_seconds": 1830.4,
                  "tracks": [
                    {
                      "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                      "kind": "subtitles",
                      "source": "generated",
                      "status": "ready",
                      "language": "en",
                      "name": "English"
                    },
                    {
                      "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
                      "kind": "chapters",
                      "source": "generated",
                      "status": "ready"
                    }
                  ],
                  "created_at": "2026-11-18T09:30:00Z",
                  "updated_at": "2026-11-18T09:34:12Z"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "asset_deleted",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "asset_deleted"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Sets the title; `\"\"` or `null` clears it. A change raises `version` and sends `video.asset.updated`; the same title changes nothing."
      },
      "delete": {
        "operationId": "assets_delete",
        "summary": "Delete an asset",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "apiKey": [
              "assets:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Asset ID (ast_\u2026)."
          }
        ],
        "responses": {
          "200": {
            "description": "Files are gone",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Asset"
                },
                "example": {
                  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "status": "deleted",
                  "version": 5,
                  "passthrough": "lesson_42",
                  "title": "Lesson 42: Sorting",
                  "base_url": "https://media.example.com",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": false,
                      "status": "revoked"
                    }
                  ],
                  "duration_seconds": 1830.4,
                  "tracks": [
                    {
                      "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                      "kind": "subtitles",
                      "source": "generated",
                      "status": "ready",
                      "language": "en",
                      "name": "English"
                    },
                    {
                      "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
                      "kind": "chapters",
                      "source": "generated",
                      "status": "ready"
                    }
                  ],
                  "created_at": "2026-11-18T09:30:00Z",
                  "updated_at": "2026-11-18T09:34:12Z"
                }
              }
            }
          },
          "202": {
            "description": "The delete job runs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Asset"
                },
                "example": {
                  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "status": "deleted",
                  "version": 5,
                  "passthrough": "lesson_42",
                  "title": "Lesson 42: Sorting",
                  "base_url": "https://media.example.com",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": false,
                      "status": "revoking"
                    }
                  ],
                  "duration_seconds": 1830.4,
                  "tracks": [
                    {
                      "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                      "kind": "subtitles",
                      "source": "generated",
                      "status": "ready",
                      "language": "en",
                      "name": "English"
                    },
                    {
                      "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
                      "kind": "chapters",
                      "source": "generated",
                      "status": "ready"
                    }
                  ],
                  "created_at": "2026-11-18T09:30:00Z",
                  "updated_at": "2026-11-18T09:34:12Z"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Playback stops at once. `200` once the files are gone, `202` while the delete job runs."
      }
    },
    "/v1/assets/{id}/reencode": {
      "post": {
        "operationId": "assets_reencode",
        "summary": "Re-encode an asset",
        "tags": [
          "Videos"
        ],
        "security": [
          {
            "apiKey": [
              "assets:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Asset ID (ast_\u2026)."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Reencode"
              },
              "example": {
                "renditions": [
                  "1080p",
                  "720p",
                  "480p"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                },
                "example": {
                  "id": "job_01jq68ea3qk8sxe3rv83fez7sf",
                  "kind": "reencode",
                  "status": "queued"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "job_active, source_missing, asset_not_ready, asset_deleted, idempotency_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "job_active",
                                "source_missing",
                                "asset_not_ready",
                                "asset_deleted",
                                "idempotency_in_progress"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "idempotency_key_reused",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "idempotency_key_reused"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Encodes the source again, for example with other `renditions`. The current output keeps playing until the new one is ready. `409 job_active` (with `job_id`) while another job changes the asset; `supersede` cancels it."
      }
    },
    "/v1/assets/{id}/tracks": {
      "post": {
        "operationId": "tracks_create",
        "summary": "Make subtitles or chapters",
        "tags": [
          "Subtitles and chapters"
        ],
        "security": [
          {
            "apiKey": [
              "assets:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Asset ID (ast_\u2026)."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTrack"
              },
              "example": {
                "kind": "subtitles"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackJob"
                },
                "example": {
                  "track": {
                    "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                    "kind": "subtitles",
                    "source": "generated",
                    "status": "preparing"
                  },
                  "job": {
                    "id": "job_01jq68ea3qk8sxe3rv83fez7sf",
                    "kind": "transcribe",
                    "status": "queued"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "asset_not_ready, no_audio, subtitles_not_ready, chapters_not_connected, job_active, asset_deleted, idempotency_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "asset_not_ready",
                                "no_audio",
                                "subtitles_not_ready",
                                "chapters_not_connected",
                                "job_active",
                                "asset_deleted",
                                "idempotency_in_progress"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "idempotency_key_reused",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "idempotency_key_reused"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Makes a new subtitles or chapters track. The old one keeps playing until the new one is ready. Chapters need ready subtitles and a connected LLM."
      }
    },
    "/v1/assets/{id}/tracks/{track_id}": {
      "get": {
        "operationId": "tracks_get",
        "summary": "Get a track",
        "tags": [
          "Subtitles and chapters"
        ],
        "security": [
          {
            "apiKey": [
              "assets:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Asset ID (ast_\u2026)."
          },
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The track; chapters once a chapters track is ready",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackDetail"
                },
                "example": {
                  "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
                  "kind": "chapters",
                  "source": "generated",
                  "status": "ready",
                  "duration_ms": 1830400,
                  "chapters": [
                    {
                      "start_ms": 0,
                      "end_ms": 412000,
                      "title": "Why sorting matters"
                    },
                    {
                      "start_ms": 412000,
                      "end_ms": 1830400,
                      "title": "Merge sort"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "A track, with its chapters once a chapters track is ready."
      },
      "delete": {
        "operationId": "tracks_delete",
        "summary": "Delete a track",
        "tags": [
          "Subtitles and chapters"
        ],
        "security": [
          {
            "apiKey": [
              "assets:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Asset ID (ast_\u2026)."
          },
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "No route lists it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Asset"
                },
                "example": {
                  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "status": "ready",
                  "version": 6,
                  "passthrough": "lesson_42",
                  "title": "Lesson 42: Sorting",
                  "base_url": "https://media.example.com",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": true,
                      "status": "active"
                    }
                  ],
                  "duration_seconds": 1830.4,
                  "tracks": [
                    {
                      "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
                      "kind": "chapters",
                      "source": "generated",
                      "status": "ready"
                    }
                  ],
                  "created_at": "2026-11-18T09:30:00Z",
                  "updated_at": "2026-11-18T09:34:12Z"
                }
              }
            }
          },
          "202": {
            "description": "Being unpublished",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Asset"
                },
                "example": {
                  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "status": "ready",
                  "version": 5,
                  "passthrough": "lesson_42",
                  "title": "Lesson 42: Sorting",
                  "base_url": "https://media.example.com",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": true,
                      "status": "active"
                    }
                  ],
                  "duration_seconds": 1830.4,
                  "tracks": [
                    {
                      "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
                      "kind": "chapters",
                      "source": "generated",
                      "status": "ready"
                    }
                  ],
                  "created_at": "2026-11-18T09:30:00Z",
                  "updated_at": "2026-11-18T09:34:12Z"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Removes a track: its file and transcript go at once. `200` once no playlist lists it, `202` while it is unpublished."
      }
    },
    "/v1/assets/{id}/tracks/{track_id}/transcript": {
      "get": {
        "operationId": "tracks_transcript",
        "summary": "Get a subtitles track's transcript",
        "tags": [
          "Subtitles and chapters"
        ],
        "security": [
          {
            "apiKey": [
              "assets:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Asset ID (ast_\u2026)."
          },
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "words",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Include word timings."
          }
        ],
        "responses": {
          "200": {
            "description": "The transcript",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Transcript"
                },
                "example": {
                  "track_id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                  "language": "en",
                  "duration_ms": 1830400,
                  "text": "Today we look at three ways to sort a list.",
                  "segments": [
                    {
                      "id": "s0",
                      "start_ms": 0,
                      "end_ms": 4200,
                      "text": "Today we look at three ways to sort a list."
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "track_not_ready",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "track_not_ready"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "A subtitles track's transcript, from the moment the track reads `ready`; `409 track_not_ready` before. Add `words=true` for word timings."
      }
    },
    "/v1/assets/{id}/playback-ids": {
      "post": {
        "operationId": "playbackIds_create",
        "summary": "Add a playback ID",
        "tags": [
          "Playback IDs"
        ],
        "security": [
          {
            "apiKey": [
              "assets:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Asset ID (ast_\u2026)."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePlaybackID"
              },
              "example": {
                "policy": "public"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackID"
                },
                "example": {
                  "id": "pid_01jmgkyp0c3ct46ees12paekfv",
                  "policy": "public",
                  "playable": true,
                  "status": "active"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "asset_deleted, too_many_playback_ids, idempotency_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "asset_deleted",
                                "too_many_playback_ids",
                                "idempotency_in_progress"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "idempotency_key_reused",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "idempotency_key_reused"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Adds a playback ID. A `signed` one plays only with a token your backend signs; a `public` one plays for anyone with the URL."
      }
    },
    "/v1/assets/{id}/playback-ids/{pid}": {
      "delete": {
        "operationId": "playbackIds_delete",
        "summary": "Revoke a playback ID",
        "tags": [
          "Playback IDs"
        ],
        "security": [
          {
            "apiKey": [
              "assets:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Asset ID (ast_\u2026)."
          },
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackID"
                },
                "example": {
                  "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                  "policy": "signed",
                  "playable": false,
                  "status": "revoked"
                }
              }
            }
          },
          "202": {
            "description": "Revoking",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackID"
                },
                "example": {
                  "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                  "policy": "signed",
                  "playable": false,
                  "status": "revoking"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Revokes a playback ID: `200 revoked` once it is unpublished, `202 revoking` before. Its playback stops; the asset's other IDs keep playing."
      }
    },
    "/v1/assets/{id}/shares": {
      "post": {
        "operationId": "shares_create",
        "summary": "Create a share link",
        "tags": [
          "Share links"
        ],
        "security": [
          {
            "apiKey": [
              "assets:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Asset ID (ast_\u2026)."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateShare"
              },
              "example": {
                "name": "For the review",
                "expires_at": "2026-12-01T00:00:00Z"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Share"
                },
                "example": {
                  "id": "shr_01jepn315k8tfeyh86qtbhnna7",
                  "asset_id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "name": "For the review",
                  "url": "https://video.example.com/s/QR2V7M4K5X3T6WAY5ZEB2CND4F",
                  "playback_id": "pid_01jmgkyp0c3ct46ees12paekfv",
                  "expires_at": "2026-12-01T00:00:00Z",
                  "status": "active",
                  "created_at": "2026-11-18T09:30:00Z"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "asset_deleted, too_many_playback_ids, idempotency_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "asset_deleted",
                                "too_many_playback_ids",
                                "idempotency_in_progress"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "idempotency_key_reused",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "idempotency_key_reused"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Makes a share link and its own signed playback ID. `url` is the page to send. `name` is one line of up to 100 characters; `expires_at` must be in the future and can't be changed later. Allowed while the asset is processing."
      },
      "get": {
        "operationId": "shares_list",
        "summary": "List an asset's share links",
        "tags": [
          "Share links"
        ],
        "security": [
          {
            "apiKey": [
              "assets:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Asset ID (ast_\u2026)."
          }
        ],
        "responses": {
          "200": {
            "description": "Newest first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShareList"
                },
                "example": {
                  "data": [
                    {
                      "id": "shr_01jepn315k8tfeyh86qtbhnna7",
                      "asset_id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                      "name": "For the review",
                      "url": "https://video.example.com/s/QR2V7M4K5X3T6WAY5ZEB2CND4F",
                      "playback_id": "pid_01jmgkyp0c3ct46ees12paekfv",
                      "expires_at": "2026-12-01T00:00:00Z",
                      "status": "active",
                      "created_at": "2026-11-18T09:30:00Z",
                      "views_30d": 27
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "The asset's share links, newest first, each with `views_30d`: its views over the last 30 UTC days."
      }
    },
    "/v1/shares/{id}": {
      "delete": {
        "operationId": "shares_delete",
        "summary": "Revoke a share link",
        "tags": [
          "Share links"
        ],
        "security": [
          {
            "apiKey": [
              "assets:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Unpublished",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Share"
                },
                "example": {
                  "id": "shr_01jepn315k8tfeyh86qtbhnna7",
                  "asset_id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "name": "For the review",
                  "url": "https://video.example.com/s/QR2V7M4K5X3T6WAY5ZEB2CND4F",
                  "playback_id": "pid_01jmgkyp0c3ct46ees12paekfv",
                  "expires_at": "2026-12-01T00:00:00Z",
                  "status": "revoked",
                  "created_at": "2026-11-18T09:30:00Z"
                }
              }
            }
          },
          "202": {
            "description": "Revoking",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Share"
                },
                "example": {
                  "id": "shr_01jepn315k8tfeyh86qtbhnna7",
                  "asset_id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "name": "For the review",
                  "url": "https://video.example.com/s/QR2V7M4K5X3T6WAY5ZEB2CND4F",
                  "playback_id": "pid_01jmgkyp0c3ct46ees12paekfv",
                  "expires_at": "2026-12-01T00:00:00Z",
                  "status": "revoked",
                  "created_at": "2026-11-18T09:30:00Z"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Revokes the link's playback ID: `200` once unpublished, `202` while revoking. Revoking again changes nothing."
      }
    },
    "/v1/shares/{id}/stream-url": {
      "post": {
        "operationId": "shares_streamUrl",
        "summary": "A signed master.m3u8 URL for a share link",
        "tags": [
          "Share links"
        ],
        "security": [
          {
            "apiKey": [
              "assets:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamURL"
                },
                "example": {
                  "url": "https://media.example.com/v/eyJhbGciOiJFUzI1NiIs.../pid_01jmgkyp0c3ct46ees12paekfv/master.m3u8",
                  "expires_at": "2026-11-25T09:30:00Z"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "share_expired, share_revoked, asset_not_ready",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "share_expired",
                                "share_revoked",
                                "asset_not_ready"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "A signed `master.m3u8` URL for players that can't open the share page. It can't refresh: it lasts until the link's expiry or the longest token lifetime, whichever is first, and stops when the link is revoked."
      }
    },
    "/v1/events": {
      "get": {
        "operationId": "events_poll",
        "summary": "Long-poll the app's webhook events",
        "tags": [
          "Events"
        ],
        "security": [
          {
            "apiKey": [
              "assets:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "The created_at (RFC 3339) of the newest event you have; the poll waits for a newer one."
          },
          {
            "name": "wait",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Oldest first, at most 100",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventList"
                },
                "example": {
                  "data": [
                    {
                      "id": "evt_01j2ef9545dh466aggzfdgtejb",
                      "created_at": "2026-11-18T09:34:12Z",
                      "body": {
                        "id": "evt_01j2ef9545dh466aggzfdgtejb",
                        "type": "video.asset.ready",
                        "created_at": "2026-11-18T09:34:12Z",
                        "data": {
                          "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                          "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                          "status": "ready",
                          "version": 4,
                          "passthrough": "lesson_42",
                          "title": "Lesson 42: Sorting",
                          "base_url": "https://media.example.com",
                          "playback_ids": [
                            {
                              "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                              "policy": "signed",
                              "playable": true,
                              "status": "active"
                            }
                          ],
                          "duration_seconds": 1830.4,
                          "tracks": [
                            {
                              "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                              "kind": "subtitles",
                              "source": "generated",
                              "status": "ready",
                              "language": "en",
                              "name": "English"
                            },
                            {
                              "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
                              "kind": "chapters",
                              "source": "generated",
                              "status": "ready"
                            }
                          ],
                          "created_at": "2026-11-18T09:30:00Z",
                          "updated_at": "2026-11-18T09:34:12Z"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "The app's webhook events created at or after `since` (default now), oldest first, up to 100. `body` is exactly what an endpoint receives. Long-polls up to `wait` seconds (at most 25) until an event is newer than `after`, the `created_at` of the newest event you have."
      }
    },
    "/v1/app": {
      "get": {
        "operationId": "app_get",
        "summary": "The key's own app",
        "tags": [
          "App"
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The app",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/App"
                },
                "example": {
                  "id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "name": "Course site",
                  "scopes": [
                    "uploads:write",
                    "assets:read",
                    "assets:write"
                  ],
                  "public_url": "https://video.example.com",
                  "base_url": "https://media.example.com",
                  "max_token_lifetime_seconds": 604800,
                  "upload_origins": [
                    "https://video.example.com"
                  ],
                  "signing_keys": [
                    {
                      "kid": "kid_01jsxwyx7223sqpr1we59kgw33",
                      "public_key_pem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE...\n-----END PUBLIC KEY-----\n",
                      "created_at": "2026-11-18T09:30:00Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "The key's own app. `base_url` is the media origin playback URLs start with; `upload_origins` are where a browser sends parts. With `base_url`, they are what a page's Content-Security-Policy must allow. A token's `exp - iat` may not exceed `max_token_lifetime_seconds`; `signing_keys` are the keys that still verify tokens, newest first."
      }
    },
    "/v1/analytics": {
      "get": {
        "operationId": "analytics_get",
        "summary": "The app's analytics",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "24h",
                "7d",
                "30d",
                "90d"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Totals and series",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Analytics"
                },
                "example": {
                  "totals": {
                    "views": 1840,
                    "watch_seconds": 302400,
                    "unique_viewers": 412,
                    "bytes_delivered": 98123456789
                  },
                  "previous": {
                    "views": 1502,
                    "watch_seconds": 251000,
                    "unique_viewers": null,
                    "bytes_delivered": 80211000000
                  },
                  "series": [
                    {
                      "t": "2026-11-17T00:00:00Z",
                      "views": 260,
                      "watch_seconds": 43100,
                      "bytes_delivered": 14000000000
                    }
                  ],
                  "top_assets": [
                    {
                      "asset_id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                      "title": "Lesson 42: Sorting",
                      "views": 310,
                      "watch_seconds": 61000,
                      "bytes_delivered": 17000000000
                    }
                  ],
                  "storage": {
                    "source_bytes": 524288000,
                    "media_bytes": 2147483648,
                    "total_bytes": 2671771648
                  },
                  "collecting": {
                    "builtin": true,
                    "edge": "not_used"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Totals, the same number of whole buckets just before (`previous`), a zero-filled series (hourly for `24h`, daily otherwise; the last bucket is partial), storage bytes currently held (`storage`), and the top 10 live videos by views (`top_assets`). `unique_viewers` counts distinct `vid` claims in tokens (by hour for `24h`, by UTC day otherwise, excluding poster fetches) and is `null` when no view carried one."
      }
    },
    "/v1/analytics/assets/{id}": {
      "get": {
        "operationId": "analytics_asset",
        "summary": "One asset's analytics",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "apiKey": [
              "analytics:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Asset ID (ast_\u2026)."
          },
          {
            "name": "range",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "24h",
                "7d",
                "30d",
                "90d"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Totals and series, without top_assets",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Analytics"
                },
                "example": {
                  "totals": {
                    "views": 1840,
                    "watch_seconds": 302400,
                    "unique_viewers": 412,
                    "bytes_delivered": 98123456789
                  },
                  "previous": {
                    "views": 1502,
                    "watch_seconds": 251000,
                    "unique_viewers": null,
                    "bytes_delivered": 80211000000
                  },
                  "series": [
                    {
                      "t": "2026-11-17T00:00:00Z",
                      "views": 260,
                      "watch_seconds": 43100,
                      "bytes_delivered": 14000000000
                    }
                  ],
                  "storage": {
                    "source_bytes": 52428800,
                    "media_bytes": 214748364,
                    "total_bytes": 267177164
                  },
                  "collecting": {
                    "builtin": true,
                    "edge": "not_used"
                  }
                }
              }
            }
          },
          "401": {
            "description": "unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "unauthorized"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "insufficient_scope"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "The same for one video, without `top_assets`. A deleted video keeps its history."
      }
    },
    "/v1/app-pairings": {
      "post": {
        "operationId": "appPairings_start",
        "summary": "Start an app pairing (npx @clipmux/node init)",
        "tags": [
          "App pairing"
        ],
        "security": [],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartPairing"
              },
              "example": {
                "name": "Course site",
                "hostname": "laptop.local",
                "client": "@clipmux/node 0.1.0"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Show code; open verify_url; poll",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pairing"
                },
                "example": {
                  "code": "KXFT-9M2Q",
                  "poll_token": "K4M2QX7R3VZ6W5TYBJ2C3DNF7G",
                  "verify_url": "https://video.example.com/connect?code=KXFT-9M2Q",
                  "expires_at": "2026-11-18T09:40:00Z",
                  "interval_seconds": 2
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, too_many_pairings",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited",
                                "too_many_pairings"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Starts a pairing: show the `code` and open `verify_url`, where the owner checks the code and approves. The code works for 10 minutes. `429 too_many_pairings` while 10 wait for the owner."
      }
    },
    "/v1/app-pairings/poll": {
      "post": {
        "operationId": "appPairings_poll",
        "summary": "Poll an app pairing",
        "tags": [
          "App pairing"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PollPairing"
              },
              "example": {
                "poll_token": "K4M2QX7R3VZ6W5TYBJ2C3DNF7G"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The first poll after approval carries credentials, once",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PairingStatus"
                },
                "example": {
                  "status": "pending"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "pairing_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "pairing_not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "Poll every `interval_seconds`. The first poll after approval carries `credentials`, and is the only one that ever does: they are deleted as they are returned, so a later poll is `404 pairing_not_found`."
      }
    },
    "/s/{secret}/playback": {
      "post": {
        "operationId": "sharePage_playback",
        "summary": "A share link's playback session",
        "tags": [
          "Share page"
        ],
        "security": [],
        "parameters": [
          {
            "name": "secret",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "viewer_id": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{16,64}$"
                  }
                }
              },
              "example": {
                "viewer_id": "b7f3k9q2m4x8r1v6t0w5"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A token for the link's playback ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharePlayback"
                },
                "example": {
                  "title": "Lesson 42: Sorting",
                  "duration_seconds": 1830.4,
                  "base_url": "https://media.example.com",
                  "playback_id": "pid_01jmgkyp0c3ct46ees12paekfv",
                  "token": "eyJhbGciOiJFUzI1NiIs...",
                  "expires_at": "2026-11-18T13:30:00Z",
                  "poster_url": "https://media.example.com/v/eyJhbGciOiJFUzI1NiIs.../pid_01jmgkyp0c3ct46ees12paekfv/poster.jpg",
                  "tracks": [
                    {
                      "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                      "kind": "subtitles",
                      "source": "generated",
                      "status": "ready",
                      "language": "en",
                      "name": "English"
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "invalid_request"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "share_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "share_not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "409": {
            "description": "asset_not_ready",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "asset_not_ready"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "410": {
            "description": "share_expired",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "share_expired"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "description": "What the share page's script asks for: a `v` token for the link's playback ID, valid until the earliest of the link's expiry, max(2 x duration, 4 h) and the longest token lifetime. A `viewer_id` of 16 to 64 `[A-Za-z0-9_-]` characters counts as a unique viewer."
      }
    },
    "/v/{token}/{pid}/master.m3u8": {
      "get": {
        "operationId": "delivery_signedMaster",
        "summary": "Signed HLS master playlist",
        "tags": [
          "Delivery"
        ],
        "servers": [
          {
            "url": "{base_url}",
            "variables": {
              "base_url": {
                "default": "https://media.example.net",
                "description": "An asset's base_url"
              }
            }
          }
        ],
        "security": [],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ES256 JWT signed with the app's key: header kid; claims sub (playback ID), aud (v, or t for posters only), iat, exp, optional vid."
          },
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Playback ID"
          }
        ],
        "description": "401 token_expired: fetch a new token. 403 denied: stop.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/vnd.apple.mpegurl": {
                "schema": {
                  "type": "string"
                },
                "example": "#EXTM3U\n#EXT-X-MEDIA:TYPE=AUDIO,URI=\"out_01jwmgegachysgyeayn62q1gdp/audio/index.m3u8\",GROUP-ID=\"a\",NAME=\"audio\"\n#EXT-X-STREAM-INF:BANDWIDTH=5400000,RESOLUTION=1920x1080,AUDIO=\"a\"\nout_01jwmgegachysgyeayn62q1gdp/1080p/index.m3u8\n#EXT-X-STREAM-INF:BANDWIDTH=1200000,RESOLUTION=854x480,AUDIO=\"a\"\nout_01jwmgegachysgyeayn62q1gdp/480p/index.m3u8\n"
              }
            }
          },
          "401": {
            "description": "token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "token_expired"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "denied",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "denied"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/p/{pid}/master.m3u8": {
      "get": {
        "operationId": "delivery_publicMaster",
        "summary": "Public HLS master playlist",
        "tags": [
          "Delivery"
        ],
        "servers": [
          {
            "url": "{base_url}",
            "variables": {
              "base_url": {
                "default": "https://media.example.net",
                "description": "An asset's base_url"
              }
            }
          }
        ],
        "security": [],
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Playback ID"
          }
        ],
        "description": "Only for a public playback ID.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/vnd.apple.mpegurl": {
                "schema": {
                  "type": "string"
                },
                "example": "#EXTM3U\n#EXT-X-MEDIA:TYPE=AUDIO,URI=\"out_01jwmgegachysgyeayn62q1gdp/audio/index.m3u8\",GROUP-ID=\"a\",NAME=\"audio\"\n#EXT-X-STREAM-INF:BANDWIDTH=5400000,RESOLUTION=1920x1080,AUDIO=\"a\"\nout_01jwmgegachysgyeayn62q1gdp/1080p/index.m3u8\n#EXT-X-STREAM-INF:BANDWIDTH=1200000,RESOLUTION=854x480,AUDIO=\"a\"\nout_01jwmgegachysgyeayn62q1gdp/480p/index.m3u8\n"
              }
            }
          },
          "403": {
            "description": "denied",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "denied"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v/{token}/{pid}/poster.jpg": {
      "get": {
        "operationId": "delivery_signedPoster",
        "summary": "Signed poster",
        "tags": [
          "Delivery"
        ],
        "servers": [
          {
            "url": "{base_url}",
            "variables": {
              "base_url": {
                "default": "https://media.example.net",
                "description": "An asset's base_url"
              }
            }
          }
        ],
        "security": [],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ES256 JWT signed with the app's key: header kid; claims sub (playback ID), aud (v, or t for posters only), iat, exp, optional vid."
          },
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Playback ID"
          }
        ],
        "description": "A t token is enough.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "token_expired"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "denied",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "denied"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/p/{pid}/poster.jpg": {
      "get": {
        "operationId": "delivery_publicPoster",
        "summary": "Public poster",
        "tags": [
          "Delivery"
        ],
        "servers": [
          {
            "url": "{base_url}",
            "variables": {
              "base_url": {
                "default": "https://media.example.net",
                "description": "An asset's base_url"
              }
            }
          }
        ],
        "security": [],
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Playback ID"
          }
        ],
        "description": "A public playback ID's poster, a JPEG of a frame near the start.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "denied",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "denied"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v/{token}/{pid}/tracks/{track_id}.vtt": {
      "get": {
        "operationId": "delivery_signedTrack",
        "summary": "A track's sidecar VTT",
        "tags": [
          "Delivery"
        ],
        "servers": [
          {
            "url": "{base_url}",
            "variables": {
              "base_url": {
                "default": "https://media.example.net",
                "description": "An asset's base_url"
              }
            }
          }
        ],
        "security": [],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ES256 JWT signed with the app's key: header kid; claims sub (playback ID), aud (v, or t for posters only), iat, exp, optional vid."
          },
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Playback ID"
          },
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "A ready track's WebVTT file, for players that show subtitles from a sidecar file rather than the playlist. A chapters track's file is at the same path.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/vtt": {
                "schema": {
                  "type": "string"
                },
                "example": "WEBVTT\n\n00:00:00.000 --> 00:00:04.200\nToday we look at three ways to sort a list.\n"
              }
            }
          },
          "401": {
            "description": "token_expired",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "token_expired"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "denied",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "denied"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/p/{pid}/tracks/{track_id}.vtt": {
      "get": {
        "operationId": "delivery_publicTrack",
        "summary": "A public track's sidecar VTT",
        "tags": [
          "Delivery"
        ],
        "servers": [
          {
            "url": "{base_url}",
            "variables": {
              "base_url": {
                "default": "https://media.example.net",
                "description": "An asset's base_url"
              }
            }
          }
        ],
        "security": [],
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Playback ID"
          },
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "A public playback ID's track as WebVTT.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/vtt": {
                "schema": {
                  "type": "string"
                },
                "example": "WEBVTT\n\n00:00:00.000 --> 00:00:04.200\nToday we look at three ways to sort a list.\n"
              }
            }
          },
          "403": {
            "description": "denied",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "denied"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_found"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "rate_limited",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "rate_limited"
                              ]
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "video.asset.ready": {
      "post": {
        "operationId": "webhook_ready",
        "summary": "video.asset.ready",
        "description": "The video is ready to play: its first encode is done and published. Delivery is at least once and unordered: verify `X-Webhook-Signature` over the raw body, reject a timestamp more than 300 s off, dedupe on `X-Webhook-Id`, and re-fetch the asset before acting on it. Retries back off for 24 hours.",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEvent"
          },
          {
            "$ref": "#/components/parameters/WebhookId"
          },
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "id": "evt_01j2ef9545dh466aggzfdgtejb",
                "type": "video.asset.ready",
                "created_at": "2026-11-18T09:34:12Z",
                "data": {
                  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "status": "ready",
                  "version": 4,
                  "passthrough": "lesson_42",
                  "title": "Lesson 42: Sorting",
                  "base_url": "https://media.example.com",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": true,
                      "status": "active"
                    }
                  ],
                  "duration_seconds": 1830.4,
                  "tracks": [
                    {
                      "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                      "kind": "subtitles",
                      "source": "generated",
                      "status": "ready",
                      "language": "en",
                      "name": "English"
                    },
                    {
                      "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
                      "kind": "chapters",
                      "source": "generated",
                      "status": "ready"
                    }
                  ],
                  "created_at": "2026-11-18T09:30:00Z",
                  "updated_at": "2026-11-18T09:34:12Z"
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any 2xx; redirects are not followed."
          }
        }
      }
    },
    "video.asset.updated": {
      "post": {
        "operationId": "webhook_updated",
        "summary": "video.asset.updated",
        "description": "The asset changed after it was ready: a re-encode finished, its title changed, a playback ID was published, or it moved storage. Re-fetch and keep the highest `version`. Delivery is at least once and unordered: verify `X-Webhook-Signature` over the raw body, reject a timestamp more than 300 s off, dedupe on `X-Webhook-Id`, and re-fetch the asset before acting on it. Retries back off for 24 hours.",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEvent"
          },
          {
            "$ref": "#/components/parameters/WebhookId"
          },
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "id": "evt_01j2ef9545dh466aggzfdgtejb",
                "type": "video.asset.updated",
                "created_at": "2026-11-18T09:34:12Z",
                "data": {
                  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "status": "ready",
                  "version": 4,
                  "passthrough": "lesson_42",
                  "title": "Lesson 42: Sorting",
                  "base_url": "https://media.example.com",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": true,
                      "status": "active"
                    }
                  ],
                  "duration_seconds": 1830.4,
                  "tracks": [
                    {
                      "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                      "kind": "subtitles",
                      "source": "generated",
                      "status": "ready",
                      "language": "en",
                      "name": "English"
                    },
                    {
                      "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
                      "kind": "chapters",
                      "source": "generated",
                      "status": "ready"
                    }
                  ],
                  "created_at": "2026-11-18T09:30:00Z",
                  "updated_at": "2026-11-18T09:34:12Z"
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any 2xx; redirects are not followed."
          }
        }
      }
    },
    "video.asset.errored": {
      "post": {
        "operationId": "webhook_errored",
        "summary": "video.asset.errored",
        "description": "The video can't be played: the upload, import or first encode failed. `data.error_code` says why. Delivery is at least once and unordered: verify `X-Webhook-Signature` over the raw body, reject a timestamp more than 300 s off, dedupe on `X-Webhook-Id`, and re-fetch the asset before acting on it. Retries back off for 24 hours.",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEvent"
          },
          {
            "$ref": "#/components/parameters/WebhookId"
          },
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "id": "evt_01j2ef9545dh466aggzfdgtejb",
                "type": "video.asset.errored",
                "created_at": "2026-11-18T09:34:12Z",
                "data": {
                  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "status": "errored",
                  "version": 2,
                  "passthrough": "lesson_42",
                  "title": "Lesson 42: Sorting",
                  "base_url": "https://media.example.com",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": true,
                      "status": "active"
                    }
                  ],
                  "duration_seconds": null,
                  "tracks": [],
                  "created_at": "2026-11-18T09:30:00Z",
                  "updated_at": "2026-11-18T09:30:00Z",
                  "error_code": "unsupported_source"
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any 2xx; redirects are not followed."
          }
        }
      }
    },
    "video.asset.reencode_failed": {
      "post": {
        "operationId": "webhook_reencode_failed",
        "summary": "video.asset.reencode_failed",
        "description": "A re-encode failed. The video keeps playing its previous output; `job.error_code` says why. Delivery is at least once and unordered: verify `X-Webhook-Signature` over the raw body, reject a timestamp more than 300 s off, dedupe on `X-Webhook-Id`, and re-fetch the asset before acting on it. Retries back off for 24 hours.",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEvent"
          },
          {
            "$ref": "#/components/parameters/WebhookId"
          },
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "id": "evt_01j2ef9545dh466aggzfdgtejb",
                "type": "video.asset.reencode_failed",
                "created_at": "2026-11-18T09:34:12Z",
                "data": {
                  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "status": "ready",
                  "version": 4,
                  "passthrough": "lesson_42",
                  "title": "Lesson 42: Sorting",
                  "base_url": "https://media.example.com",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": true,
                      "status": "active"
                    }
                  ],
                  "duration_seconds": 1830.4,
                  "tracks": [
                    {
                      "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                      "kind": "subtitles",
                      "source": "generated",
                      "status": "ready",
                      "language": "en",
                      "name": "English"
                    },
                    {
                      "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
                      "kind": "chapters",
                      "source": "generated",
                      "status": "ready"
                    }
                  ],
                  "created_at": "2026-11-18T09:30:00Z",
                  "updated_at": "2026-11-18T09:34:12Z"
                },
                "job": {
                  "id": "job_01jq68ea3qk8sxe3rv83fez7sf",
                  "kind": "reencode",
                  "error_code": "transcode_failed"
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any 2xx; redirects are not followed."
          }
        }
      }
    },
    "video.asset.deleted": {
      "post": {
        "operationId": "webhook_deleted",
        "summary": "video.asset.deleted",
        "description": "The video was deleted, and its playback has stopped. Delivery is at least once and unordered: verify `X-Webhook-Signature` over the raw body, reject a timestamp more than 300 s off, dedupe on `X-Webhook-Id`, and re-fetch the asset before acting on it. Retries back off for 24 hours.",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEvent"
          },
          {
            "$ref": "#/components/parameters/WebhookId"
          },
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "id": "evt_01j2ef9545dh466aggzfdgtejb",
                "type": "video.asset.deleted",
                "created_at": "2026-11-18T09:34:12Z",
                "data": {
                  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "status": "deleted",
                  "version": 4,
                  "passthrough": "lesson_42",
                  "title": "Lesson 42: Sorting",
                  "base_url": "https://media.example.com",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": true,
                      "status": "active"
                    }
                  ],
                  "duration_seconds": 1830.4,
                  "tracks": [
                    {
                      "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                      "kind": "subtitles",
                      "source": "generated",
                      "status": "ready",
                      "language": "en",
                      "name": "English"
                    },
                    {
                      "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
                      "kind": "chapters",
                      "source": "generated",
                      "status": "ready"
                    }
                  ],
                  "created_at": "2026-11-18T09:30:00Z",
                  "updated_at": "2026-11-18T09:34:12Z"
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any 2xx; redirects are not followed."
          }
        }
      }
    },
    "video.asset.track.ready": {
      "post": {
        "operationId": "webhook_track_ready",
        "summary": "video.asset.track.ready",
        "description": "A subtitles or chapters track is ready. `track` names it. Delivery is at least once and unordered: verify `X-Webhook-Signature` over the raw body, reject a timestamp more than 300 s off, dedupe on `X-Webhook-Id`, and re-fetch the asset before acting on it. Retries back off for 24 hours.",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEvent"
          },
          {
            "$ref": "#/components/parameters/WebhookId"
          },
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "id": "evt_01j2ef9545dh466aggzfdgtejb",
                "type": "video.asset.track.ready",
                "created_at": "2026-11-18T09:34:12Z",
                "data": {
                  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "status": "ready",
                  "version": 4,
                  "passthrough": "lesson_42",
                  "title": "Lesson 42: Sorting",
                  "base_url": "https://media.example.com",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": true,
                      "status": "active"
                    }
                  ],
                  "duration_seconds": 1830.4,
                  "tracks": [
                    {
                      "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                      "kind": "subtitles",
                      "source": "generated",
                      "status": "ready",
                      "language": "en",
                      "name": "English"
                    },
                    {
                      "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
                      "kind": "chapters",
                      "source": "generated",
                      "status": "ready"
                    }
                  ],
                  "created_at": "2026-11-18T09:30:00Z",
                  "updated_at": "2026-11-18T09:34:12Z"
                },
                "track": {
                  "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                  "kind": "subtitles"
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any 2xx; redirects are not followed."
          }
        }
      }
    },
    "video.asset.track.errored": {
      "post": {
        "operationId": "webhook_track_errored",
        "summary": "video.asset.track.errored",
        "description": "A track couldn't be made. `track.error_code` says why, for example `no_audio`. Delivery is at least once and unordered: verify `X-Webhook-Signature` over the raw body, reject a timestamp more than 300 s off, dedupe on `X-Webhook-Id`, and re-fetch the asset before acting on it. Retries back off for 24 hours.",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEvent"
          },
          {
            "$ref": "#/components/parameters/WebhookId"
          },
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "id": "evt_01j2ef9545dh466aggzfdgtejb",
                "type": "video.asset.track.errored",
                "created_at": "2026-11-18T09:34:12Z",
                "data": {
                  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "status": "ready",
                  "version": 4,
                  "passthrough": "lesson_42",
                  "title": "Lesson 42: Sorting",
                  "base_url": "https://media.example.com",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": true,
                      "status": "active"
                    }
                  ],
                  "duration_seconds": 1830.4,
                  "tracks": [
                    {
                      "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                      "kind": "subtitles",
                      "source": "generated",
                      "status": "ready",
                      "language": "en",
                      "name": "English"
                    },
                    {
                      "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
                      "kind": "chapters",
                      "source": "generated",
                      "status": "ready"
                    }
                  ],
                  "created_at": "2026-11-18T09:30:00Z",
                  "updated_at": "2026-11-18T09:34:12Z"
                },
                "track": {
                  "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                  "kind": "subtitles",
                  "error_code": "no_audio"
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any 2xx; redirects are not followed."
          }
        }
      }
    },
    "video.asset.track.deleted": {
      "post": {
        "operationId": "webhook_track_deleted",
        "summary": "video.asset.track.deleted",
        "description": "A track was deleted. Delivery is at least once and unordered: verify `X-Webhook-Signature` over the raw body, reject a timestamp more than 300 s off, dedupe on `X-Webhook-Id`, and re-fetch the asset before acting on it. Retries back off for 24 hours.",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookEvent"
          },
          {
            "$ref": "#/components/parameters/WebhookId"
          },
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "id": "evt_01j2ef9545dh466aggzfdgtejb",
                "type": "video.asset.track.deleted",
                "created_at": "2026-11-18T09:34:12Z",
                "data": {
                  "id": "ast_01jhsze3w2mhtbzr5qv1w5xy68",
                  "app_id": "app_01j6hrm8vmt8f27hd13py42rdc",
                  "status": "ready",
                  "version": 4,
                  "passthrough": "lesson_42",
                  "title": "Lesson 42: Sorting",
                  "base_url": "https://media.example.com",
                  "playback_ids": [
                    {
                      "id": "pid_01j88d4vyy93fwe7p3aqr8kcqz",
                      "policy": "signed",
                      "playable": true,
                      "status": "active"
                    }
                  ],
                  "duration_seconds": 1830.4,
                  "tracks": [
                    {
                      "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                      "kind": "subtitles",
                      "source": "generated",
                      "status": "ready",
                      "language": "en",
                      "name": "English"
                    },
                    {
                      "id": "trk_01jbz1ke29rzfnpwz5grhd401k",
                      "kind": "chapters",
                      "source": "generated",
                      "status": "ready"
                    }
                  ],
                  "created_at": "2026-11-18T09:30:00Z",
                  "updated_at": "2026-11-18T09:34:12Z"
                },
                "track": {
                  "id": "trk_01j0qtsj1vyp4dyn7fsdkb9t8q",
                  "kind": "subtitles"
                }
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Any 2xx; redirects are not followed."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "error"
        ],
        "description": "Every error. Details sit beside code and message, all strings (e.g. retry_after, job_id)."
      },
      "PlaybackID": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The playback ID (pid_...) that goes in playback URLs."
          },
          "policy": {
            "type": "string",
            "enum": [
              "signed",
              "public"
            ],
            "description": "signed plays only with a token your backend signs; public plays for anyone with the URL."
          },
          "playable": {
            "type": "boolean",
            "description": "Whether the ID plays now: false until the asset has an output, and once revoked."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "revoking",
              "revoked"
            ],
            "description": "active, revoking while its routes are unpublished, then revoked."
          },
          "share": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "description": "Present when a share link owns this ID."
          }
        },
        "required": [
          "id",
          "policy",
          "playable",
          "status"
        ]
      },
      "Track": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "subtitles",
              "chapters"
            ],
            "description": "subtitles, or chapters."
          },
          "source": {
            "type": "string",
            "description": "generated: made by speech recognition or an LLM."
          },
          "status": {
            "type": "string",
            "enum": [
              "preparing",
              "ready",
              "errored"
            ],
            "description": "preparing, ready or errored."
          },
          "language": {
            "type": "string",
            "description": "The detected language code for subtitles, for example en or hi."
          },
          "name": {
            "type": "string"
          },
          "error_code": {
            "type": "string",
            "description": "Why the track errored, for example no_audio or llm_not_connected."
          }
        },
        "required": [
          "id",
          "kind",
          "source",
          "status"
        ]
      },
      "Chapter": {
        "type": "object",
        "properties": {
          "start_ms": {
            "type": "integer"
          },
          "end_ms": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "start_ms",
          "end_ms",
          "title"
        ]
      },
      "TrackDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Track"
          },
          {
            "type": "object",
            "properties": {
              "duration_ms": {
                "type": "integer"
              },
              "chapters": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Chapter"
                }
              }
            }
          }
        ]
      },
      "Word": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "start_ms": {
            "type": "integer"
          },
          "end_ms": {
            "type": "integer"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "start_ms",
          "end_ms",
          "text"
        ]
      },
      "Segment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "start_ms": {
            "type": "integer"
          },
          "end_ms": {
            "type": "integer"
          },
          "text": {
            "type": "string"
          },
          "words": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Word"
            }
          }
        },
        "required": [
          "id",
          "start_ms",
          "end_ms",
          "text"
        ]
      },
      "Transcript": {
        "type": "object",
        "properties": {
          "track_id": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "duration_ms": {
            "type": "integer"
          },
          "text": {
            "type": "string"
          },
          "segments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Segment"
            }
          }
        },
        "required": [
          "track_id",
          "language",
          "duration_ms",
          "text",
          "segments"
        ]
      },
      "Asset": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The asset ID (ast_...)."
          },
          "app_id": {
            "type": "string",
            "description": "The app the asset belongs to."
          },
          "status": {
            "type": "string",
            "enum": [
              "waiting_upload",
              "processing",
              "ready",
              "errored",
              "deleted"
            ],
            "description": "waiting_upload until the file arrives, processing while it encodes, then ready or errored; deleted once deleted."
          },
          "version": {
            "type": "integer",
            "description": "Rises on every change; keep the highest seen."
          },
          "passthrough": {
            "type": "string",
            "description": "Your own reference, such as lesson_42. Absent when unset."
          },
          "title": {
            "type": "string",
            "description": "For people: not unique and never part of a URL. One line, up to 200 characters. Absent when unset."
          },
          "renditions": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Renditions"
              }
            ],
            "description": "The renditions this asset's outputs are encoded at; absent means every rung up to the source."
          },
          "error_code": {
            "type": "string",
            "description": "Why the asset is errored, for example upload_cancelled, import_failed or unsupported_source."
          },
          "base_url": {
            "type": "string",
            "description": "The media origin playback URLs start with."
          },
          "playback_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlaybackID"
            },
            "description": "Every playback ID, including revoked ones and those a share link owns."
          },
          "duration_seconds": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null until the first output exists."
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Track"
            },
            "description": "Subtitles and chapters tracks; retired and deleted tracks are not listed."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "app_id",
          "status",
          "version",
          "base_url",
          "playback_ids",
          "duration_seconds",
          "tracks",
          "created_at",
          "updated_at"
        ]
      },
      "AssetList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Asset"
            }
          },
          "next_cursor": {
            "type": "string"
          }
        },
        "required": [
          "data"
        ]
      },
      "Generate": {
        "type": "object",
        "properties": {
          "subtitles": {
            "type": "boolean"
          },
          "chapters": {
            "type": "boolean",
            "description": "Implies subtitles."
          }
        }
      },
      "CreateUpload": {
        "type": "object",
        "properties": {
          "size": {
            "type": "integer",
            "minimum": 1,
            "description": "The file size in bytes."
          },
          "playback_policy": {
            "type": "string",
            "enum": [
              "signed",
              "public"
            ],
            "description": "The policy of the playback ID made with the asset. Default signed."
          },
          "passthrough": {
            "type": "string",
            "description": "Your own reference; it comes back on the asset and its webhooks."
          },
          "title": {
            "type": "string",
            "maxLength": 200,
            "description": "One line, up to 200 characters."
          },
          "generate": {
            "$ref": "#/components/schemas/Generate",
            "description": "Ask for subtitles and chapters once the video is ready; chapters imply subtitles."
          },
          "renditions": {
            "$ref": "#/components/schemas/Renditions"
          }
        },
        "required": [
          "size"
        ]
      },
      "Upload": {
        "type": "object",
        "properties": {
          "upload_id": {
            "type": "string",
            "description": "The upload ID (upl_...)."
          },
          "asset_id": {
            "type": "string",
            "description": "The asset this upload fills."
          },
          "part_size": {
            "type": "integer",
            "description": "Bytes in every part but the last."
          },
          "part_count": {
            "type": "integer",
            "description": "How many parts to send."
          },
          "upload_token": {
            "type": "string",
            "description": "Hand this to the browser; it reaches only this upload."
          },
          "playback_ids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlaybackID"
            },
            "description": "The asset's playback IDs, already made."
          }
        },
        "required": [
          "upload_id",
          "asset_id",
          "part_size",
          "part_count",
          "playback_ids"
        ]
      },
      "PartNumbers": {
        "type": "object",
        "properties": {
          "part_numbers": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          }
        },
        "required": [
          "part_numbers"
        ]
      },
      "SignedParts": {
        "type": "object",
        "properties": {
          "parts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "part_number": {
                  "type": "integer"
                },
                "url": {
                  "type": "string"
                }
              },
              "required": [
                "part_number",
                "url"
              ]
            }
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "parts",
          "expires_at"
        ]
      },
      "StoredParts": {
        "type": "object",
        "properties": {
          "parts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "part_number": {
                  "type": "integer"
                },
                "etag": {
                  "type": "string"
                },
                "size": {
                  "type": "integer"
                }
              },
              "required": [
                "part_number",
                "etag",
                "size"
              ]
            }
          }
        },
        "required": [
          "parts"
        ]
      },
      "CompleteUpload": {
        "type": "object",
        "properties": {
          "parts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "part_number": {
                  "type": "integer"
                },
                "etag": {
                  "type": "string"
                }
              },
              "required": [
                "part_number",
                "etag"
              ]
            }
          }
        },
        "required": [
          "parts"
        ]
      },
      "CreateAsset": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "format": "uri"
              },
              "playback_policy": {
                "type": "string",
                "enum": [
                  "signed",
                  "public"
                ]
              },
              "passthrough": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "generate": {
                "$ref": "#/components/schemas/Generate"
              },
              "renditions": {
                "$ref": "#/components/schemas/Renditions"
              }
            },
            "required": [
              "url"
            ],
            "title": "ImportURL"
          },
          {
            "type": "object",
            "properties": {
              "agent_source_id": {
                "type": "string"
              },
              "playback_policy": {
                "type": "string",
                "enum": [
                  "signed",
                  "public"
                ]
              },
              "passthrough": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "generate": {
                "$ref": "#/components/schemas/Generate"
              },
              "renditions": {
                "$ref": "#/components/schemas/Renditions"
              }
            },
            "required": [
              "agent_source_id"
            ],
            "title": "AttachAgentSource"
          }
        ]
      },
      "UpdateAsset": {
        "type": "object",
        "properties": {
          "title": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "title"
        ]
      },
      "Job": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "status"
        ]
      },
      "Reencode": {
        "type": "object",
        "properties": {
          "supersede": {
            "type": "boolean"
          },
          "renditions": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Renditions"
              }
            ],
            "description": "Replaces the asset's choice for this output and the ones after it; leave it out to keep it."
          }
        }
      },
      "CreateTrack": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "subtitles",
              "chapters"
            ]
          },
          "supersede": {
            "type": "boolean"
          }
        },
        "required": [
          "kind"
        ]
      },
      "TrackJob": {
        "type": "object",
        "properties": {
          "track": {
            "$ref": "#/components/schemas/Track"
          },
          "job": {
            "$ref": "#/components/schemas/Job"
          }
        },
        "required": [
          "track",
          "job"
        ]
      },
      "CreatePlaybackID": {
        "type": "object",
        "properties": {
          "policy": {
            "type": "string",
            "enum": [
              "signed",
              "public"
            ]
          }
        },
        "required": [
          "policy"
        ]
      },
      "Share": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "asset_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "description": "The page to send: {public_url}/s/{secret}."
          },
          "playback_id": {
            "type": "string",
            "description": "The signed playback ID the link owns."
          },
          "expires_at": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "When the link stops working, or null for never."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "revoked",
              "expired"
            ],
            "description": "active, revoked or expired."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "views_30d": {
            "type": "integer",
            "description": "Views over the last 30 UTC days, in lists."
          }
        },
        "required": [
          "id",
          "asset_id",
          "name",
          "url",
          "playback_id",
          "expires_at",
          "status",
          "created_at"
        ]
      },
      "CreateShare": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ShareList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Share"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "StreamURL": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "url",
          "expires_at"
        ]
      },
      "Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "body": {
            "$ref": "#/components/schemas/WebhookEvent",
            "description": "Exactly what a webhook endpoint receives."
          }
        },
        "required": [
          "id",
          "created_at",
          "body"
        ]
      },
      "EventList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "WebhookEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The event ID (evt_...), the same as X-Webhook-Id. Dedupe on it."
          },
          "type": {
            "type": "string",
            "enum": [
              "video.asset.ready",
              "video.asset.updated",
              "video.asset.errored",
              "video.asset.reencode_failed",
              "video.asset.deleted",
              "video.asset.track.ready",
              "video.asset.track.errored",
              "video.asset.track.deleted"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "$ref": "#/components/schemas/Asset",
            "description": "The asset when the event was made. Re-fetch it before acting."
          },
          "job": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "kind": {
                "type": "string"
              },
              "error_code": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "kind"
            ],
            "description": "The job behind the event, for re-encodes."
          },
          "track": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "kind": {
                "type": "string"
              },
              "error_code": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "kind"
            ],
            "description": "The track, for track events."
          }
        },
        "required": [
          "id",
          "type",
          "created_at",
          "data"
        ]
      },
      "App": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "public_url": {
            "type": "string",
            "description": "Where the API is."
          },
          "base_url": {
            "type": "string",
            "description": "The media origin playback URLs start with."
          },
          "max_token_lifetime_seconds": {
            "type": "integer",
            "description": "The longest a playback token may last: exp - iat."
          },
          "upload_origins": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Where a browser sends upload parts: this server (filesystem storage) and each bucket's public endpoint. With base_url, what a page with the uploader and player must allow in its Content-Security-Policy."
          },
          "signing_keys": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kid": {
                  "type": "string"
                },
                "public_key_pem": {
                  "type": "string"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "retired_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "kid",
                "public_key_pem",
                "created_at"
              ]
            },
            "description": "The keys that still verify tokens, newest first."
          }
        },
        "required": [
          "id",
          "name",
          "scopes",
          "public_url",
          "base_url",
          "max_token_lifetime_seconds",
          "upload_origins",
          "signing_keys"
        ]
      },
      "AnalyticsTotals": {
        "type": "object",
        "properties": {
          "views": {
            "type": "integer"
          },
          "watch_seconds": {
            "type": "integer"
          },
          "unique_viewers": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "bytes_delivered": {
            "type": "integer"
          }
        },
        "required": [
          "views",
          "watch_seconds",
          "unique_viewers",
          "bytes_delivered"
        ]
      },
      "StorageTotals": {
        "type": "object",
        "properties": {
          "source_bytes": {
            "type": "integer"
          },
          "media_bytes": {
            "type": "integer"
          },
          "total_bytes": {
            "type": "integer"
          }
        },
        "required": [
          "source_bytes",
          "media_bytes",
          "total_bytes"
        ]
      },
      "Analytics": {
        "type": "object",
        "properties": {
          "totals": {
            "$ref": "#/components/schemas/AnalyticsTotals"
          },
          "previous": {
            "$ref": "#/components/schemas/AnalyticsTotals"
          },
          "series": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "t": {
                  "type": "string",
                  "format": "date-time"
                },
                "views": {
                  "type": "integer"
                },
                "watch_seconds": {
                  "type": "integer"
                },
                "bytes_delivered": {
                  "type": "integer"
                }
              },
              "required": [
                "t",
                "views",
                "watch_seconds",
                "bytes_delivered"
              ]
            }
          },
          "top_assets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "asset_id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "views": {
                  "type": "integer"
                },
                "watch_seconds": {
                  "type": "integer"
                },
                "bytes_delivered": {
                  "type": "integer"
                }
              },
              "required": [
                "asset_id",
                "views",
                "watch_seconds",
                "bytes_delivered"
              ]
            }
          },
          "storage": {
            "$ref": "#/components/schemas/StorageTotals"
          },
          "collecting": {
            "type": "object",
            "properties": {
              "builtin": {
                "type": "boolean"
              },
              "edge": {
                "type": "string",
                "enum": [
                  "not_used",
                  "not_connected",
                  "connected"
                ]
              },
              "edge_needs_redeploy": {
                "type": "boolean"
              },
              "edge_error": {
                "type": "string"
              },
              "edge_pulled_through": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "builtin",
              "edge"
            ]
          }
        },
        "required": [
          "totals",
          "previous",
          "series",
          "storage",
          "collecting"
        ]
      },
      "SharePlayback": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "duration_seconds": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "base_url": {
            "type": "string"
          },
          "playback_id": {
            "type": "string"
          },
          "token": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "poster_url": {
            "type": "string"
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Track"
            }
          }
        },
        "required": [
          "base_url",
          "playback_id",
          "token",
          "expires_at",
          "poster_url",
          "tracks"
        ],
        "description": "Also the shape @clipmux/player's session-url expects from an app's own handler."
      },
      "StartPairing": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "hostname": {
            "type": "string",
            "maxLength": 253
          },
          "client": {
            "type": "string",
            "maxLength": 100
          }
        }
      },
      "Pairing": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Show it; the owner checks it matches on verify_url. Any case, the dash optional."
          },
          "poll_token": {
            "type": "string"
          },
          "verify_url": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "interval_seconds": {
            "type": "integer",
            "description": "How often to poll."
          }
        },
        "required": [
          "code",
          "poll_token",
          "verify_url",
          "expires_at",
          "interval_seconds"
        ]
      },
      "PollPairing": {
        "type": "object",
        "properties": {
          "poll_token": {
            "type": "string"
          }
        },
        "required": [
          "poll_token"
        ]
      },
      "Credentials": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "app_id": {
            "type": "string"
          },
          "app_name": {
            "type": "string"
          },
          "api_key_id": {
            "type": "string"
          },
          "api_key": {
            "type": "string",
            "description": "A new API key with the default scopes. Shown once."
          },
          "signing_kid": {
            "type": "string"
          },
          "signing_key": {
            "type": "string",
            "description": "PKCS #8 PEM."
          },
          "webhook_endpoint_id": {
            "type": "string"
          },
          "webhook_secret": {
            "type": "string",
            "description": "Present when a webhook URL was given."
          },
          "env": {
            "type": "string",
            "description": "The same values as a .env block."
          }
        },
        "required": [
          "url",
          "app_id",
          "app_name",
          "api_key_id",
          "api_key",
          "signing_kid",
          "signing_key",
          "env"
        ]
      },
      "PairingStatus": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "denied",
              "expired"
            ]
          },
          "credentials": {
            "$ref": "#/components/schemas/Credentials"
          }
        },
        "required": [
          "status"
        ]
      },
      "Renditions": {
        "type": "array",
        "description": "The ladder rungs to encode, e.g. [\"1080p\", \"480p\"]. Rungs above the source are skipped; if none chosen fits, the largest rung that fits is encoded. Leave it out for every rung up to the source. Shown largest first.",
        "items": {
          "type": "string",
          "enum": [
            "2160p",
            "1440p",
            "1080p",
            "720p",
            "480p",
            "360p"
          ]
        },
        "minItems": 1,
        "maxItems": 6,
        "uniqueItems": true
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "An app's API key (cmx_\u2026), from your backend only. Scopes: uploads:write, assets:read, assets:write, analytics:read."
      },
      "uploadToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "An upload's upload_token: safe for the browser, reaches only that upload."
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 255
        },
        "description": "A retry with the same key and request returns the first response; a different request is 422 idempotency_key_reused."
      },
      "WebhookEvent": {
        "name": "X-Webhook-Event",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "WebhookId": {
        "name": "X-Webhook-Id",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "WebhookTimestamp": {
        "name": "X-Webhook-Timestamp",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[0-9]+$"
        }
      },
      "WebhookSignature": {
        "name": "X-Webhook-Signature",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^sha256=[0-9a-f]{64}$"
        },
        "description": "sha256= and the hex HMAC-SHA256 of \"{timestamp}.{raw body}\", keyed with the endpoint secret (whsec_\u2026, prefix included)."
      }
    }
  },
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Uploads",
      "description": "Resumable browser uploads. Your backend creates the upload; the browser sends S3 multipart parts straight to storage with the upload token, then completes it."
    },
    {
      "name": "Videos",
      "description": "A video is an asset in the API: its status, playback IDs, tracks and renditions. Find one by your own `passthrough`, page through changes, rename, re-encode or delete it."
    },
    {
      "name": "Subtitles and chapters",
      "description": "Tracks made after a video is ready: subtitles from speech, and chapters from an LLM. A new track replaces the old one only once it is ready."
    },
    {
      "name": "Playback IDs",
      "description": "Each video has one or more playback IDs, public or signed, each revocable on its own."
    },
    {
      "name": "Share links",
      "description": "A share link plays one video for anyone holding its URL, until it expires or is revoked."
    },
    {
      "name": "Events",
      "description": "The same events your webhook endpoints receive, read by long-polling. `npx @clipmux/node listen` uses it."
    },
    {
      "name": "App",
      "description": "The API key's own app: its URLs, scopes, token lifetime and signing keys."
    },
    {
      "name": "Analytics",
      "description": "Views, watch time, unique viewers and bytes delivered, counted at delivery. Needs the `analytics:read` scope."
    },
    {
      "name": "App pairing",
      "description": "How `npx @clipmux/node init` gets an app's credentials without anyone copying a secret. None of these routes needs a key."
    },
    {
      "name": "Share page",
      "description": "The token endpoint behind a share link's page. It needs no session or key."
    },
    {
      "name": "Delivery",
      "description": "Playback, from the media URL (`base_url`): HLS playlists, posters and subtitle files. Signed playback IDs take an ES256 token your backend signs; public ones take none."
    }
  ],
  "x-tagGroups": [
    {
      "name": "Videos",
      "tags": [
        "Uploads",
        "Videos",
        "Subtitles and chapters",
        "Playback IDs",
        "Share links"
      ]
    },
    {
      "name": "Your app",
      "tags": [
        "App",
        "Events",
        "Analytics",
        "App pairing"
      ]
    },
    {
      "name": "Playback",
      "tags": [
        "Delivery",
        "Share page"
      ]
    }
  ]
}
