{
  "openapi": "3.1.0",
  "info": {
    "title": "Katto API",
    "version": "1.7.1",
    "description": "Turn long videos into scored, reframed, captioned 9:16 clips. Submit a video URL, poll for results. Usage draws from your plan's monthly video quota.",
    "contact": {
      "name": "Katto",
      "url": "https://katto.tech/docs/api"
    },
    "license": {
      "name": "Proprietary"
    }
  },
  "servers": [
    {
      "url": "https://katto.tech/api/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/jobs": {
      "post": {
        "operationId": "createJob",
        "summary": "Create a clipping job",
        "description": "Submit a video URL (YouTube, Twitch, Kick, Vimeo, Zoom, Google Drive, Dropbox, Loom, LinkedIn, Facebook, Rumble, Dailymotion, Medal.tv, or a direct https link to a .mp4/.mov/.m4v/.webm/.mkv file). For a local file use POST /uploads. Consumes one slot of your monthly video quota. Pass an Idempotency-Key header to make retries safe.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Optional. Makes the request idempotent: a repeat with the same key returns the original job (200, with idempotent_replay:true) instead of creating and quota-charging a second one. Recommended when you auto-retry on network errors. While the first request is still in-flight, a duplicate returns 409 (retry shortly)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Public video URL.",
                    "example": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Optional public https URL. Receives a signed POST (X-Katto-Signature: HMAC-SHA256 of timestamp.body) when the job completes."
                  },
                  "config": {
                    "type": "object",
                    "description": "Optional pre-clip settings.",
                    "properties": {
                      "genre": {
                        "type": "string",
                        "example": "podcast"
                      },
                      "clipLength": {
                        "type": "string",
                        "enum": [
                          "lt30",
                          "30_60",
                          "60_90",
                          "90_180"
                        ]
                      },
                      "customPrompt": {
                        "type": "string",
                        "maxLength": 1000
                      },
                      "topics": {
                        "type": "string",
                        "maxLength": 500
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Idempotent replay: the original job for a reused Idempotency-Key (no new job created, no quota charged).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string"
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "idempotent_replay": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Job queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "example": "queued"
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "operationId": "listJobs",
        "summary": "List jobs",
        "description": "List your jobs, newest first. Keyset pagination: pass the previous response's next_cursor to fetch the next page.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "The next_cursor from a previous response."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional filter, e.g. completed, queued, failed."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of jobs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jobs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "status": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "completed_at": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "next_cursor": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true,
                      "description": "Pass as ?cursor= to fetch the next page; null when there are no more."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/jobs/{id}": {
      "get": {
        "operationId": "getJob",
        "summary": "Get a job",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job status and clips",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "processing",
                        "scoring",
                        "completed",
                        "failed",
                        "cancelled"
                      ]
                    },
                    "progress": {
                      "type": "object",
                      "properties": {
                        "step": {
                          "type": "string"
                        },
                        "pct": {
                          "type": "number"
                        }
                      }
                    },
                    "source": {
                      "type": "string"
                    },
                    "source_url": {
                      "type": "string"
                    },
                    "clips": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "captions_url": {
                            "type": "string",
                            "format": "uri",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "nullable": true
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "completed_at": {
                      "type": "string",
                      "format": "date-time",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "cancelJob",
        "summary": "Cancel a job",
        "description": "Cancel a still-running job (queued/processing) and refund the monthly video slot (up to the monthly refund cap). Returns 409 if the job already finished, failed, or was cancelled. Requires a key with write scope.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled and refunded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "example": "cancelled"
                    },
                    "refunded": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/jobs/{id}/transcript": {
      "get": {
        "operationId": "getTranscript",
        "summary": "Get a job's transcript",
        "description": "The compact, timestamped transcript of a completed job. Returns 404 while the job is still processing (or if it predates transcript storage).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transcript segments",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "job_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "lang": {
                      "type": "string",
                      "nullable": true,
                      "example": "en"
                    },
                    "segments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "start": {
                            "type": "number",
                            "description": "Seconds."
                          },
                          "end": {
                            "type": "number",
                            "description": "Seconds."
                          },
                          "text": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/usage": {
      "get": {
        "operationId": "getUsage",
        "summary": "Get plan usage",
        "description": "Your current plan and monthly video quota.",
        "responses": {
          "200": {
            "description": "Quota snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "plan": {
                      "type": "string",
                      "example": "pro",
                      "description": "Internal plan code as stored ('free', 'solo', 'pro' = Creator). Prefer plan_name for display."
                    },
                    "plan_name": {
                      "type": "string",
                      "example": "Creator",
                      "description": "Commercial plan name, as shown on the pricing page (Free, Solo, Creator)."
                    },
                    "videos_used": {
                      "type": "integer",
                      "example": 6
                    },
                    "videos_limit": {
                      "type": "integer",
                      "example": 25
                    },
                    "videos_remaining": {
                      "type": "integer",
                      "example": 19
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/jobs/{id}/clips": {
      "get": {
        "operationId": "getJobClips",
        "summary": "Get a job's finished clips",
        "description": "Convenience projection of just the finished clips (9:16 MP4 url + caption SRT url + title + score). Empty list while the job is still processing.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Finished clips",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "job_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string"
                    },
                    "clips": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "captions_url": {
                            "type": "string",
                            "format": "uri",
                            "nullable": true
                          },
                          "title": {
                            "type": "string",
                            "nullable": true
                          },
                          "score": {
                            "type": "number",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "operationId": "createClip",
        "summary": "Create a clip from a time range",
        "description": "Creates a NEW clip from the job's source video, between start_seconds and end_seconds (seconds of the SOURCE video, e.g. from GET /jobs/{id}/transcript). Same rules as the editor's Create clip: 3-180 s, at most 10 created clips per video, one clip in preparation at a time (409), and only while the source is kept (7 days after the job, else 410). Does NOT consume video quota. The clip is rendered asynchronously and appended to the job's clips: poll GET /jobs/{id}/clips until a clip with clip_index = expected_clip_index appears. Requires write scope.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "start_seconds",
                  "end_seconds"
                ],
                "properties": {
                  "start_seconds": {
                    "type": "number",
                    "minimum": 0,
                    "example": 312.4
                  },
                  "end_seconds": {
                    "type": "number",
                    "example": 356
                  },
                  "aspect": {
                    "type": "string",
                    "enum": [
                      "9:16",
                      "1:1",
                      "16:9"
                    ],
                    "description": "Defaults to the job's setting."
                  },
                  "auto_reframe": {
                    "type": "boolean",
                    "description": "false = plain center crop instead of following the speaker."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Clip queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "queued"
                    },
                    "job_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "start_seconds": {
                      "type": "number"
                    },
                    "end_seconds": {
                      "type": "number"
                    },
                    "duration_seconds": {
                      "type": "number"
                    },
                    "title": {
                      "type": "string"
                    },
                    "has_captions": {
                      "type": "boolean",
                      "description": "false when no stored word timings cover the range: the clip renders without captions."
                    },
                    "expected_clip_index": {
                      "type": "integer"
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "410": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/me": {
      "get": {
        "operationId": "getMe",
        "summary": "Account & key introspection",
        "description": "Who owns this key, what it can do (scopes), and the current plan/quota. Lets a client self-configure without guessing.",
        "responses": {
          "200": {
            "description": "Account snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "plan": {
                      "type": "string",
                      "example": "pro",
                      "description": "Internal plan code as stored ('free', 'solo', 'pro' = Creator). Prefer plan_name for display."
                    },
                    "plan_name": {
                      "type": "string",
                      "example": "Creator",
                      "description": "Commercial plan name, as shown on the pricing page (Free, Solo, Creator)."
                    },
                    "key": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "scopes": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "read",
                              "write"
                            ]
                          }
                        }
                      }
                    },
                    "quota": {
                      "type": "object",
                      "properties": {
                        "videos_used": {
                          "type": "integer"
                        },
                        "videos_limit": {
                          "type": "integer"
                        },
                        "videos_remaining": {
                          "type": "integer"
                        },
                        "period_start": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/uploads": {
      "post": {
        "operationId": "createUpload",
        "summary": "Reserve an upload (clip a local file)",
        "description": "Step 1 of clipping a local file. Reserves a job and returns a presigned R2 PUT url. PUT the file bytes to `upload_url` with the given Content-Type, then call POST /v1/uploads/{job_id}/complete. No quota is charged until the complete step. Requires write scope.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "filename",
                  "content_type",
                  "size"
                ],
                "properties": {
                  "filename": {
                    "type": "string",
                    "maxLength": 200,
                    "example": "podcast.mp4"
                  },
                  "content_type": {
                    "type": "string",
                    "enum": [
                      "video/mp4",
                      "video/quicktime",
                      "video/webm",
                      "video/x-matroska"
                    ]
                  },
                  "size": {
                    "type": "integer",
                    "description": "File size in bytes. Cap: 3 GB Free, 5 GB Solo and Creator."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Upload reserved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "job_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "upload_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Presigned R2 PUT url (2h expiry)."
                    },
                    "method": {
                      "type": "string",
                      "example": "PUT"
                    },
                    "headers": {
                      "type": "object",
                      "description": "Headers to send with the PUT (Content-Type)."
                    },
                    "expires_in": {
                      "type": "integer",
                      "example": 7200
                    },
                    "complete_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/uploads/{id}/complete": {
      "post": {
        "operationId": "completeUpload",
        "summary": "Finish an upload and start clipping",
        "description": "Step 2 of clipping a local file. Call after PUTting the file to `upload_url`. Verifies the file landed, charges one video of quota, and queues processing. Requires write scope.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The job_id from POST /v1/uploads."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "config": {
                    "type": "object",
                    "description": "Optional pre-clip settings (same as POST /v1/jobs).",
                    "properties": {
                      "genre": {
                        "type": "string"
                      },
                      "clipLength": {
                        "type": "string",
                        "enum": [
                          "lt30",
                          "30_60",
                          "60_90",
                          "90_180"
                        ]
                      },
                      "customPrompt": {
                        "type": "string",
                        "maxLength": 1000
                      },
                      "topics": {
                        "type": "string",
                        "maxLength": 500
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Queued for processing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "example": "queued"
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/jobs/{id}/clips/{index}/rerender": {
      "post": {
        "operationId": "rerenderClip",
        "summary": "Re-render a clip (new layout, captions, or dub)",
        "description": "Re-render one finished clip with a new reframe layout_mode and/or caption_style and/or dubbing. Does NOT consume video quota (it edits an existing clip); the original clip url is preserved and the result is versioned. Returns a rerender_id; poll GET /v1/jobs/{id}/rerenders/{rerender_id}. Requires write scope. The clip must carry editing metadata (recent jobs).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "index",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 49
            },
            "description": "0-based clip index."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Provide at least one of layout_mode, caption_style, dub.",
                "properties": {
                  "layout_mode": {
                    "type": "string",
                    "enum": [
                      "face_tracking",
                      "wide",
                      "split_screen",
                      "stacked",
                      "passthrough",
                      "grid_3",
                      "grid_4"
                    ]
                  },
                  "caption_style": {
                    "type": "string",
                    "maxLength": 40
                  },
                  "dub": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "en",
                        "es",
                        "fr",
                        "it",
                        "pt",
                        "hi",
                        "ja",
                        "zh",
                        "de",
                        "ko",
                        "nl",
                        "pl",
                        "ru",
                        "tr",
                        "id",
                        "vi",
                        "th",
                        "uk",
                        "ar"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Re-render queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rerender_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "example": "queued"
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/jobs/{id}/rerenders/{rerender_id}": {
      "get": {
        "operationId": "getRerender",
        "summary": "Poll a re-render",
        "description": "Poll a re-render started by POST .../rerender. status is one of queued/processing/completed/failed; clip_url is populated when completed.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "rerender_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Re-render status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rerender_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "processing",
                        "completed",
                        "failed"
                      ]
                    },
                    "clip_url": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "captions_url": {
                      "type": "string",
                      "format": "uri",
                      "nullable": true
                    },
                    "duration": {
                      "type": "number",
                      "nullable": true
                    },
                    "error": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/brand-kit": {
      "get": {
        "operationId": "getBrandKit",
        "summary": "Get your brand kits",
        "description": "Your saved brand kits (colors, caption font/position, default layout, watermark url). Read scope.",
        "responses": {
          "200": {
            "description": "Brand kits",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "brand_kits": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "primary_color": {
                            "type": "string"
                          },
                          "accent_color": {
                            "type": "string"
                          },
                          "caption_font": {
                            "type": "string"
                          },
                          "caption_position": {
                            "type": "string"
                          },
                          "default_layout": {
                            "type": "string"
                          },
                          "watermark_url": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/webhook": {
      "get": {
        "operationId": "getWebhook",
        "summary": "Get your webhook signing secret",
        "description": "Your webhook signing secret + how to verify signed completion callbacks. Generated on first access. Read scope.",
        "responses": {
          "200": {
            "description": "Webhook signing details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "signing_secret": {
                      "type": "string"
                    },
                    "signature_header": {
                      "type": "string",
                      "example": "X-Katto-Signature"
                    },
                    "timestamp_header": {
                      "type": "string",
                      "example": "X-Katto-Timestamp"
                    },
                    "scheme": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/jobs/{id}/more": {
      "post": {
        "operationId": "requestMoreClips",
        "summary": "Render more clips from the reserve",
        "description": "The dashboard's Show more moments: renders the next best candidates the job scored but did not render, from the cached source, and appends them to the job's clips. Does NOT consume video quota. Returns 202 when a request is queued, 200 with status 'pending' when one is already running, 200 with status 'empty' when the reserve is used up. Requires write scope.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "count": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10,
                    "default": 5
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Nothing new queued (pending or empty)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "empty"
                      ]
                    },
                    "requested": {
                      "type": "integer"
                    },
                    "remaining": {
                      "type": "integer"
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "202": {
            "description": "More clips queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "queued"
                    },
                    "requested": {
                      "type": "integer"
                    },
                    "remaining": {
                      "type": "integer"
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/jobs/{id}/clips/{index}/translate-captions": {
      "post": {
        "operationId": "translateClipCaptions",
        "summary": "Translate a clip's captions",
        "description": "Translates the clip's burned-in captions (word timings kept, audio untouched; use rerender with dub for a voice) and re-renders it. Creator feature: 403 with code 'upgrade_required' otherwise. Does NOT consume video quota. Poll status_url (GET /jobs/{id}/rerenders/{rerender_id}). Requires write scope.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "index",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 49
            },
            "description": "0-based clip index (position in the job's clips)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "language"
                ],
                "properties": {
                  "language": {
                    "type": "string",
                    "enum": [
                      "en",
                      "es",
                      "fr",
                      "it",
                      "pt",
                      "hi",
                      "ja",
                      "zh",
                      "de",
                      "ko",
                      "nl",
                      "pl",
                      "ru",
                      "tr",
                      "id",
                      "vi",
                      "th",
                      "uk",
                      "ar"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Translated render queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rerender_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "example": "queued"
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "language": {
                      "type": "string"
                    },
                    "words_translated": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/jobs/{id}/clips/{index}/retitle": {
      "post": {
        "operationId": "retitleClip",
        "summary": "Regenerate or set a clip's title",
        "description": "Without title: AI-generates a new title in the clip's language (optional style), drawing one unit from the plan's monthly title-regeneration allowance (429 with 'limit' when used up). With title: saves it as-is, free. Synchronous. Requires write scope.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "index",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 49
            },
            "description": "0-based clip index (position in the job's clips)."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "style": {
                    "type": "string",
                    "enum": [
                      "energetic",
                      "descriptive",
                      "fun",
                      "shocking"
                    ]
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "New title",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string"
                    },
                    "clip_index": {
                      "type": "integer"
                    },
                    "regenerated": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/jobs/{id}/clips/{index}/publish": {
      "post": {
        "operationId": "publishClip",
        "summary": "Publish or schedule a clip to a connected social account",
        "description": "Posts a finished clip to a social account the user connected in the Katto dashboard, through the same path as the dashboard export; with schedule_at, creates the same scheduled post as the calendar. Publishing needs a paid plan, scheduling needs Creator (403 otherwise). A platform that is not connected (or whose session expired) returns 409 with code platform_not_connected / platform_reconnect_required and connect_url. TikTok requires privacy_level (no default). NOT idempotent: every call is a new public post. Requires write scope.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "index",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 49
            },
            "description": "0-based clip index (position in the job's clips)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "platform"
                ],
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "youtube",
                      "tiktok",
                      "linkedin",
                      "instagram",
                      "bluesky",
                      "mastodon",
                      "threads"
                    ]
                  },
                  "caption": {
                    "type": "string",
                    "maxLength": 2200,
                    "description": "Post text. On YouTube it defaults the title and description."
                  },
                  "title": {
                    "type": "string",
                    "description": "YouTube title (max 100). Defaults to caption, then the clip's title."
                  },
                  "description": {
                    "type": "string",
                    "description": "YouTube description. Defaults to caption."
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "YouTube tags."
                  },
                  "privacy_status": {
                    "type": "string",
                    "enum": [
                      "public",
                      "unlisted",
                      "private"
                    ],
                    "description": "YouTube only."
                  },
                  "schedule_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Publish later instead of now: future, at most 7 days ahead."
                  },
                  "privacy_level": {
                    "type": "string",
                    "enum": [
                      "PUBLIC_TO_EVERYONE",
                      "MUTUAL_FOLLOW_FRIENDS",
                      "FOLLOWER_OF_CREATOR",
                      "SELF_ONLY"
                    ],
                    "description": "TikTok only, required for TikTok."
                  },
                  "disable_comment": {
                    "type": "boolean",
                    "description": "TikTok only."
                  },
                  "disable_duet": {
                    "type": "boolean",
                    "description": "TikTok only."
                  },
                  "disable_stitch": {
                    "type": "boolean",
                    "description": "TikTok only."
                  },
                  "brand_content": {
                    "type": "boolean",
                    "description": "TikTok only: paid partnership (cannot be SELF_ONLY)."
                  },
                  "brand_organic": {
                    "type": "boolean",
                    "description": "TikTok only: promotes the user's own business."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Published",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "published"
                    },
                    "platform": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object",
                      "description": "The platform's response (post id / url)."
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Scheduled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "scheduled"
                    },
                    "platform": {
                      "type": "string"
                    },
                    "scheduled_post_id": {
                      "type": "string"
                    },
                    "scheduled_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/connections": {
      "get": {
        "operationId": "listConnections",
        "summary": "List connected social accounts",
        "description": "Which of the 7 publishable platforms the user connected in the Katto dashboard, with the account's display name and whether a reconnect is needed (expired token that cannot be refreshed, or Mastodon without its instance). Tokens are never returned. Call before POST /jobs/{id}/clips/{index}/publish. Requires read scope.",
        "responses": {
          "200": {
            "description": "Connections, one entry per platform",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "platform": {
                            "type": "string",
                            "enum": [
                              "youtube",
                              "tiktok",
                              "linkedin",
                              "instagram",
                              "bluesky",
                              "mastodon",
                              "threads"
                            ]
                          },
                          "connected": {
                            "type": "boolean"
                          },
                          "display_name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "reconnect_required": {
                            "type": "boolean"
                          },
                          "connected_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "connect_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Where the user connects or reconnects an account."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/scheduled-posts": {
      "get": {
        "operationId": "listScheduledPosts",
        "summary": "List scheduled posts",
        "description": "The user's scheduled social posts (from publish with schedule_at, or the dashboard calendar), newest first by creation. Keyset pagination: pass next_cursor back as cursor. Requires read scope.",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "posting",
                "posted",
                "failed"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "The next_cursor from a previous response."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of scheduled posts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "scheduled_posts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "job_id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "uuid"
                          },
                          "clip_index": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "platform": {
                            "type": "string"
                          },
                          "scheduled_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "pending",
                              "posting",
                              "posted",
                              "failed"
                            ]
                          },
                          "title": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "error": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Why a failed post failed."
                          },
                          "posted_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/scheduled-posts/{id}": {
      "delete": {
        "operationId": "cancelScheduledPost",
        "summary": "Cancel a scheduled post",
        "description": "Cancels a post that has not been published (status pending or failed): the row is removed, like the dashboard calendar's delete, so it is never published. 409 if it is already posting or posted. A repeated call returns 404. Requires write scope.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Scheduled post id (scheduled_post_id from publish, or id from GET /scheduled-posts)."
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "cancelled"
                      ]
                    },
                    "previous_status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "failed"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/jobs/{id}/clips/{index}/post-text": {
      "post": {
        "operationId": "generatePostText",
        "summary": "Generate post text for a clip",
        "description": "AI-written, platform-tailored title / description / hashtags for one clip, in the clip's language, within each platform's character limits (same generator as the dashboard's export modal). Without platform, all 7 platforms. title is empty for caption-only platforms. Nothing is saved or posted; no video quota. Identical requests within an hour are served from cache. Requires write scope.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "index",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 49
            },
            "description": "0-based clip index (position in the job's clips)."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "youtube",
                      "tiktok",
                      "linkedin",
                      "instagram",
                      "bluesky",
                      "mastodon",
                      "threads"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Post text per platform",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "clip_index": {
                      "type": "integer"
                    },
                    "posts": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "hashtags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/jobs/{id}/clips/{index}/adjust": {
      "post": {
        "operationId": "adjustClip",
        "summary": "Trim or extend a clip",
        "description": "Moves the clip's start and/or end relative to its ORIGINAL bounds (repeated calls do not accumulate; positive extends, negative trims) and re-renders it, through the same pipeline as the dashboard's Adjust length. The result must last 3-180 s and stay inside the source. Extending re-cuts from the source, kept 7 days (410 after). Versioned: the original clip is kept. No video quota. Requires write scope.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "index",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 49
            },
            "description": "0-based clip index (position in the job's clips)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start_offset_seconds": {
                    "type": "number",
                    "minimum": -180,
                    "maximum": 180,
                    "description": "Positive = start earlier (extend), negative = start later (trim)."
                  },
                  "end_offset_seconds": {
                    "type": "number",
                    "minimum": -180,
                    "maximum": 180,
                    "description": "Positive = end later (extend), negative = end earlier (trim)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Re-render queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rerender_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued"
                      ]
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Poll GET /jobs/{id}/rerenders/{rerender_id}."
                    },
                    "start_seconds": {
                      "type": "number",
                      "description": "New start, in source seconds."
                    },
                    "end_seconds": {
                      "type": "number",
                      "description": "New end, in source seconds."
                    },
                    "duration_seconds": {
                      "type": "number"
                    },
                    "extended": {
                      "type": "boolean",
                      "description": "true when the clip goes past its original bounds."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "410": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/jobs/{id}/clips/{index}/hook": {
      "post": {
        "operationId": "addHook",
        "summary": "Add a hook to a clip",
        "description": "Burns a hook (large text over the first seconds) into the clip and re-renders it. Without text, the AI writes one from the clip (same generator as the editor's AI Hook). Styled like the editor's hook (white, boxed, animated). Versioned: the original clip is kept, so a new call replaces the hook. No video quota. Requires write scope.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "index",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 49
            },
            "description": "0-based clip index (position in the job's clips)."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "position": {
                    "type": "string",
                    "enum": [
                      "top",
                      "center"
                    ],
                    "default": "top"
                  },
                  "duration": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10,
                    "default": 4
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Re-render queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rerender_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued"
                      ]
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Poll GET /jobs/{id}/rerenders/{rerender_id}."
                    },
                    "hook_text": {
                      "type": "string"
                    },
                    "generated": {
                      "type": "boolean",
                      "description": "true when the AI wrote the hook."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/jobs/{id}/clips/{index}/feedback": {
      "post": {
        "operationId": "rateClip",
        "summary": "Rate a clip",
        "description": "Records the user's verdict on a clip, like the thumbs up/down of the results page (same clip_decisions record; each call appends, the latest counts). Requires write scope.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "index",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 49
            },
            "description": "0-based clip index (position in the job's clips)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rating"
                ],
                "properties": {
                  "rating": {
                    "type": "string",
                    "enum": [
                      "good",
                      "bad"
                    ]
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 2000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recorded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "clip_index": {
                      "type": "integer"
                    },
                    "rating": {
                      "type": "string",
                      "enum": [
                        "good",
                        "bad"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key created at https://katto.tech/dashboard/api-keys, sent as `Authorization: Bearer sk_live_...`."
      }
    },
    "responses": {
      "Error": {
        "description": "Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
