{"openapi":"3.1.0","info":{"title":"agentic-yt API","version":"0.1.0","description":"YouTube for AI agents: search, metadata, transcripts, comments, downloads, clips and frames.\n\n**Auth.** `Authorization: Bearer ayt_pat_…` on every route except those marked `x-scope: public`.\n\n**Ids or URLs.** Every `{id}` path parameter accepts a bare id or a full YouTube URL, percent-encoded into the segment (`/v1/videos/https%3A%2F%2Fyoutu.be%2FdQw4w9WgXcQ`). `GET /v1/resolve?url=` returns the canonical id if your client cannot encode a path segment.\n\n**Jobs.** Routes marked `x-kind: job` return a job. A cached result is `succeeded` immediately (200); otherwise the job is `queued` (202). Pass `?wait=N` (0–60 s) on the POST or on `GET /v1/jobs/{id}` to long-poll.\n\n**Errors.** Always `{ \"error\": { \"code\", \"message\", \"hint?\", \"docs_url?\" } }`. Codes: `unauthorized`, `forbidden`, `validation_failed`, `not_found`, `video_unavailable`, `account_required`, `youtube_blocked`, `quota_exceeded`, `too_long`, `rate_limited`, `job_failed`, `internal`."},"servers":[{"url":"https://api.agentic-yt.crafter.run"}],"tags":[{"name":"system"},{"name":"search"},{"name":"videos"},{"name":"channels"},{"name":"playlists"},{"name":"jobs"},{"name":"me"},{"name":"auth"}],"security":[{"bearerAuth":[]}],"paths":{"/v1/health":{"get":{"operationId":"getHealth","summary":"Liveness check","tags":["system"],"x-scope":"public","x-kind":"sync","security":[],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"ok"},"version":{"type":"string"},"time":{"type":"string","description":"ISO 8601 timestamp (UTC)."}},"required":["status","version","time"],"additionalProperties":false}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/resolve":{"get":{"operationId":"resolveUrl","summary":"Classify a YouTube URL and return its canonical id","description":"No network call to YouTube. Useful when a client cannot percent-encode a URL into a path segment.","tags":["system"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"url","in":"query","required":true,"description":"Any YouTube URL, or a bare id.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["video","channel","playlist"]},"id":{"type":"string","description":"Canonical id usable in any `{id}` path parameter."},"url":{"type":"string","description":"Canonical YouTube URL."},"playlist_id":{"description":"Set when a video URL also carried `list=`.","type":["string","null"]},"start_seconds":{"description":"Set when a video URL carried `t=`/`start=`.","type":["number","null"]}},"required":["kind","id","url","playlist_id","start_seconds"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/search":{"get":{"operationId":"search","summary":"Search YouTube for videos, channels or playlists","tags":["search"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"q","in":"query","required":true,"description":"Search query.","schema":{"type":"string","minLength":1,"maxLength":500}},{"name":"type","in":"query","required":false,"description":"Kind of result to return.","schema":{"default":"video","type":"string","enum":["video","channel","playlist"]}},{"name":"limit","in":"query","required":false,"description":"Max items to return (1–100).","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous response's `next_cursor`.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"},"type":{"type":"string","enum":["video","channel","playlist"]},"results":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"title":{"type":"string"},"duration_seconds":{"type":["number","null"]},"channel":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"name":{"type":["string","null"]},"handle":{"type":["string","null"]},"url":{"type":["string","null"]}},"required":["id","name","handle","url"],"additionalProperties":false},{"type":"null"}]},"thumbnail_url":{"type":["string","null"]},"view_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"published_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"is_live":{"type":["boolean","null"]},"type":{"type":"string","const":"video"}},"required":["id","url","title","duration_seconds","channel","thumbnail_url","view_count","published_at","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"handle":{"type":["string","null"]},"name":{"type":"string"},"description":{"type":["string","null"]},"subscriber_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"thumbnail_url":{"type":["string","null"]},"type":{"type":"string","const":"channel"}},"required":["id","url","handle","name","description","subscriber_count","thumbnail_url","type"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"title":{"type":"string"},"channel":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"name":{"type":["string","null"]},"handle":{"type":["string","null"]},"url":{"type":["string","null"]}},"required":["id","name","handle","url"],"additionalProperties":false},{"type":"null"}]},"video_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"thumbnail_url":{"type":["string","null"]},"type":{"type":"string","const":"playlist"}},"required":["id","url","title","channel","video_count","thumbnail_url","type"],"additionalProperties":false}]}},"next_cursor":{"description":"Pass as `cursor` to fetch the next page; null when there are no more.","type":["string","null"]}},"required":["query","type","results","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/videos/{id}":{"get":{"operationId":"getVideo","summary":"Video metadata","description":"Title, description, duration, channel, thumbnails, counters, chapters, tags. Stable fields are cached 7 days and counters 1 hour; `fresh=true` bypasses both.","tags":["videos"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"YouTube video id (e.g. `dQw4w9WgXcQ`) or a full YouTube URL, percent-encoded. The server resolves it to the canonical id.","schema":{"type":"string","minLength":1}},{"name":"fresh","in":"query","required":false,"description":"Bypass the metadata cache and refetch from YouTube.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"duration_seconds":{"type":["number","null"]},"channel":{"type":"object","properties":{"id":{"type":["string","null"]},"name":{"type":["string","null"]},"handle":{"type":["string","null"]},"url":{"type":["string","null"]}},"required":["id","name","handle","url"],"additionalProperties":false},"thumbnails":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"id":{"type":["string","null"]}},"required":["url","width","height"],"additionalProperties":false}},"view_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"like_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"comment_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"chapters":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"start":{"type":"number"},"end":{"type":["number","null"]}},"required":["title","start","end"],"additionalProperties":false}},"tags":{"type":"array","items":{"type":"string"}},"categories":{"type":"array","items":{"type":"string"}},"published_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"visibility":{"type":"string","enum":["public","unlisted","private","members_only","unknown"]},"is_live":{"type":"boolean"},"language":{"type":["string","null"]},"cache":{"type":"object","properties":{"hit":{"type":"boolean","description":"True when served from cache without contacting YouTube."},"stable_fetched_at":{"type":"string","description":"When title/description/chapters were fetched (7d TTL)."},"counters_fetched_at":{"type":"string","description":"When views/likes/comment count were fetched (1h TTL)."}},"required":["hit","stable_fetched_at","counters_fetched_at"],"additionalProperties":false}},"required":["id","url","title","description","duration_seconds","channel","thumbnails","view_count","like_count","comment_count","chapters","tags","categories","published_at","visibility","is_live","language","cache"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error — `error.code` is one of: `video_unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/videos/{id}/formats":{"get":{"operationId":"getVideoFormats","summary":"Available source formats and the qualities this video can be downloaded in","tags":["videos"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"YouTube video id (e.g. `dQw4w9WgXcQ`) or a full YouTube URL, percent-encoded. The server resolves it to the canonical id.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"video_id":{"type":"string"},"duration_seconds":{"type":["number","null"]},"formats":{"type":"array","items":{"type":"object","properties":{"format_id":{"type":"string"},"kind":{"type":"string","enum":["video","audio","muxed"],"description":"`muxed` carries both audio and video."},"ext":{"type":"string"},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"fps":{"type":["number","null"]},"quality_label":{"description":"e.g. `720p`, `1080p60`.","type":["string","null"]},"vcodec":{"type":["string","null"]},"acodec":{"type":["string","null"]},"bitrate_kbps":{"type":["number","null"]},"filesize_bytes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"language":{"type":["string","null"]}},"required":["format_id","kind","ext","height","width","fps","quality_label","vcodec","acodec","bitrate_kbps","filesize_bytes","language"],"additionalProperties":false}},"downloadable":{"type":"object","properties":{"video_qualities":{"type":"array","items":{"type":"string"},"description":"Values accepted as `quality` by the download endpoint for this video."},"video_formats":{"type":"array","items":{"type":"string"}},"audio_formats":{"type":"array","items":{"type":"string"}}},"required":["video_qualities","video_formats","audio_formats"],"additionalProperties":false}},"required":["video_id","duration_seconds","formats","downloadable"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error — `error.code` is one of: `video_unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/videos/{id}/thumbnail":{"get":{"operationId":"getVideoThumbnail","summary":"Thumbnail URLs for a video","tags":["videos"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"YouTube video id (e.g. `dQw4w9WgXcQ`) or a full YouTube URL, percent-encoded. The server resolves it to the canonical id.","schema":{"type":"string","minLength":1}},{"name":"quality","in":"query","required":false,"description":"Preferred size; the closest available one is returned as `thumbnail`.","schema":{"default":"maxres","type":"string","enum":["default","medium","high","standard","maxres"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"video_id":{"type":"string"},"thumbnail":{"type":"object","properties":{"url":{"type":"string"},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"id":{"type":["string","null"]}},"required":["url","width","height"],"additionalProperties":false,"description":"The selected thumbnail."},"thumbnails":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"id":{"type":["string","null"]}},"required":["url","width","height"],"additionalProperties":false},"description":"Every available size."}},"required":["video_id","thumbnail","thumbnails"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error — `error.code` is one of: `video_unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/videos/{id}/transcript":{"get":{"operationId":"getVideoTranscript","summary":"Transcript as timed segments, SRT, VTT or plain text","description":"`not_found` when the video has no captions in the requested language — list them with `/transcript/languages`.","tags":["videos"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"YouTube video id (e.g. `dQw4w9WgXcQ`) or a full YouTube URL, percent-encoded. The server resolves it to the canonical id.","schema":{"type":"string","minLength":1}},{"name":"lang","in":"query","required":false,"description":"Language code (e.g. `en`, `es`, `pt-BR`). Defaults to the video's original language; manual captions are preferred over auto-generated.","schema":{"type":"string","minLength":2,"maxLength":20}},{"name":"translate_to","in":"query","required":false,"description":"Machine-translate the transcript to this language code.","schema":{"type":"string","minLength":2,"maxLength":20}},{"name":"format","in":"query","required":false,"description":"`json` returns `segments`; `srt`, `vtt` and `txt` return the rendered text in `content`.","schema":{"default":"json","type":"string","enum":["json","srt","vtt","txt"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"video_id":{"type":"string"},"language":{"type":"string"},"kind":{"type":"string","enum":["manual","auto","translated"]},"format":{"type":"string","enum":["json","srt","vtt","txt"]},"segments":{"description":"Present when `format=json`.","type":"array","items":{"type":"object","properties":{"start":{"type":"number","description":"Seconds."},"end":{"type":"number","description":"Seconds."},"text":{"type":"string"}},"required":["start","end","text"],"additionalProperties":false}},"content":{"description":"Present when format is `srt`, `vtt` or `txt`.","type":"string"},"cache_hit":{"type":"boolean"}},"required":["video_id","language","kind","format","cache_hit"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error — `error.code` is one of: `video_unavailable`, `not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/videos/{id}/transcript/languages":{"get":{"operationId":"listTranscriptLanguages","summary":"Caption languages available for a video","tags":["videos"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"YouTube video id (e.g. `dQw4w9WgXcQ`) or a full YouTube URL, percent-encoded. The server resolves it to the canonical id.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"video_id":{"type":"string"},"languages":{"type":"array","items":{"type":"object","properties":{"lang":{"type":"string"},"name":{"type":["string","null"]},"kind":{"type":"string","enum":["manual","auto"]},"translatable":{"type":"boolean"}},"required":["lang","name","kind","translatable"],"additionalProperties":false}},"translation_languages":{"type":"array","items":{"type":"object","properties":{"lang":{"type":"string"},"name":{"type":["string","null"]}},"required":["lang","name"],"additionalProperties":false},"description":"Values accepted as `translate_to`."}},"required":["video_id","languages","translation_languages"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error — `error.code` is one of: `video_unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/videos/{id}/comments":{"get":{"operationId":"listVideoComments","summary":"Comments on a video","tags":["videos"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"YouTube video id (e.g. `dQw4w9WgXcQ`) or a full YouTube URL, percent-encoded. The server resolves it to the canonical id.","schema":{"type":"string","minLength":1}},{"name":"sort","in":"query","required":false,"schema":{"default":"top","type":"string","enum":["top","new"]}},{"name":"limit","in":"query","required":false,"description":"Max items to return (1–100).","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous response's `next_cursor`.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"video_id":{"type":"string"},"sort":{"type":"string","enum":["top","new"]},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"parent_id":{"description":"Set for replies.","type":["string","null"]},"text":{"type":"string"},"author":{"type":"object","properties":{"name":{"type":["string","null"]},"channel_id":{"type":["string","null"]},"url":{"type":["string","null"]},"thumbnail_url":{"type":["string","null"]},"is_uploader":{"type":"boolean"}},"required":["name","channel_id","url","thumbnail_url","is_uploader"],"additionalProperties":false},"like_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reply_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"is_pinned":{"type":"boolean"},"published_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]}},"required":["id","parent_id","text","author","like_count","reply_count","is_pinned","published_at"],"additionalProperties":false}},"next_cursor":{"description":"Pass as `cursor` to fetch the next page; null when there are no more.","type":["string","null"]}},"required":["video_id","sort","comments","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error — `error.code` is one of: `video_unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/channels/{id}":{"get":{"operationId":"getChannel","summary":"Channel metadata","tags":["channels"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (`UC…`), handle (`@name`) or a full channel URL, percent-encoded.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"handle":{"type":["string","null"]},"name":{"type":"string"},"description":{"type":["string","null"]},"subscriber_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"video_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"view_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"thumbnails":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"id":{"type":["string","null"]}},"required":["url","width","height"],"additionalProperties":false}},"banner_url":{"type":["string","null"]},"is_verified":{"type":["boolean","null"]}},"required":["id","url","handle","name","description","subscriber_count","video_count","view_count","thumbnails","banner_url","is_verified"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error — `error.code` is one of: `not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/channels/{id}/videos":{"get":{"operationId":"listChannelVideos","summary":"Videos uploaded by a channel","tags":["channels"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Channel id (`UC…`), handle (`@name`) or a full channel URL, percent-encoded.","schema":{"type":"string","minLength":1}},{"name":"sort","in":"query","required":false,"schema":{"default":"new","type":"string","enum":["new","popular"]}},{"name":"limit","in":"query","required":false,"description":"Max items to return (1–100).","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous response's `next_cursor`.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"channel_id":{"type":"string"},"videos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"title":{"type":"string"},"duration_seconds":{"type":["number","null"]},"channel":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"name":{"type":["string","null"]},"handle":{"type":["string","null"]},"url":{"type":["string","null"]}},"required":["id","name","handle","url"],"additionalProperties":false},{"type":"null"}]},"thumbnail_url":{"type":["string","null"]},"view_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"published_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"is_live":{"type":["boolean","null"]}},"required":["id","url","title","duration_seconds","channel","thumbnail_url","view_count","published_at"],"additionalProperties":false}},"next_cursor":{"description":"Pass as `cursor` to fetch the next page; null when there are no more.","type":["string","null"]}},"required":["channel_id","videos","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error — `error.code` is one of: `not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/playlists/{id}":{"get":{"operationId":"getPlaylist","summary":"Playlist metadata","tags":["playlists"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"YouTube playlist id (e.g. `PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf`) or a full YouTube URL, percent-encoded. The server resolves it to the canonical id.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"channel":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"name":{"type":["string","null"]},"handle":{"type":["string","null"]},"url":{"type":["string","null"]}},"required":["id","name","handle","url"],"additionalProperties":false},{"type":"null"}]},"video_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"view_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"thumbnails":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"width":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"height":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"id":{"type":["string","null"]}},"required":["url","width","height"],"additionalProperties":false}},"visibility":{"type":"string","enum":["public","unlisted","private","members_only","unknown"]},"updated_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]}},"required":["id","url","title","description","channel","video_count","view_count","thumbnails","visibility","updated_at"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error — `error.code` is one of: `not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/playlists/{id}/videos":{"get":{"operationId":"listPlaylistVideos","summary":"Videos in a playlist","tags":["playlists"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"YouTube playlist id (e.g. `PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf`) or a full YouTube URL, percent-encoded. The server resolves it to the canonical id.","schema":{"type":"string","minLength":1}},{"name":"limit","in":"query","required":false,"description":"Max items to return (1–100).","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous response's `next_cursor`.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"playlist_id":{"type":"string"},"videos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"title":{"type":"string"},"duration_seconds":{"type":["number","null"]},"channel":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"name":{"type":["string","null"]},"handle":{"type":["string","null"]},"url":{"type":["string","null"]}},"required":["id","name","handle","url"],"additionalProperties":false},{"type":"null"}]},"thumbnail_url":{"type":["string","null"]},"view_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"published_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"is_live":{"type":["boolean","null"]}},"required":["id","url","title","duration_seconds","channel","thumbnail_url","view_count","published_at"],"additionalProperties":false}},"next_cursor":{"description":"Pass as `cursor` to fetch the next page; null when there are no more.","type":["string","null"]}},"required":["playlist_id","videos","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error — `error.code` is one of: `not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/videos/{id}/download":{"post":{"operationId":"createDownload","summary":"Download a video or its audio","description":"Returns a job. If the file is already cached the job is `succeeded` immediately with `result.assets`. Pass `?wait=30` to hold the request until the job finishes.","tags":["videos","jobs"],"x-scope":"pat","x-kind":"job","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"YouTube video id (e.g. `dQw4w9WgXcQ`) or a full YouTube URL, percent-encoded. The server resolves it to the canonical id.","schema":{"type":"string","minLength":1}},{"name":"wait","in":"query","required":false,"description":"Long-poll: hold the request up to this many seconds (0–60) until the job reaches a terminal status.","schema":{"default":0,"type":"integer","minimum":0,"maximum":60}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"default":"video","description":"`video` (with audio) or `audio` only.","type":"string","enum":["video","audio"]},"format":{"description":"Container. Video: `mp4` (default) or `webm`. Audio: `mp3` (default), `wav`, `m4a`, `opus`.","type":"string","enum":["mp4","webm","mp3","wav","m4a","opus"]},"quality":{"default":"720p","description":"Video only. Max height; `best` is capped at 1080p. A lower available quality is used when the requested one does not exist.","type":"string","enum":["144p","240p","360p","480p","720p","1080p","best"]},"audio_bitrate":{"default":128,"description":"Audio only. Target bitrate in kbps (ignored for `wav`).","anyOf":[{"type":"number","const":64},{"type":"number","const":96},{"type":"number","const":128},{"type":"number","const":160},{"type":"number","const":192},{"type":"number","const":256},{"type":"number","const":320}]},"use_account":{"description":"true: use your connected YouTube account (result is private to you; `account_required` if none). false: never use it. Omitted: anonymous first, your account as fallback.","type":"boolean"}}}}}},"responses":{"200":{"description":"The job was satisfied from cache, or finished within `wait`.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["download","clip","frames"]},"status":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"progress":{"type":"number","minimum":0,"maximum":100,"description":"Percent complete."},"video_id":{"type":"string"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The normalised request body this job runs with."},"result":{"anyOf":[{"type":"object","properties":{"assets":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Direct download URL."},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mime":{"type":"string"},"filename":{"type":"string"},"cache_hit":{"type":"boolean","description":"True when the file already existed and nothing was downloaded."},"expires_at":{"description":"When `url` stops working. Re-fetch the job for a fresh URL.","anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"timestamp":{"description":"Frames only: the offset in seconds this image was taken at.","type":"number"}},"required":["url","bytes","mime","filename","cache_hit"],"additionalProperties":false}}},"required":["assets"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `succeeded`."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","validation_failed","not_found","video_unavailable","account_required","youtube_blocked","quota_exceeded","too_long","rate_limited","job_failed","internal"]},"message":{"type":"string"},"hint":{"type":"string"},"docs_url":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `failed`."},"cache_hit":{"type":"boolean","description":"True when the job was satisfied entirely from cache."},"poll_url":{"type":"string","description":"GET this (optionally with `?wait=30`) until `status` is terminal."},"created_at":{"type":"string","description":"ISO 8601 timestamp (UTC)."},"started_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]}},"required":["id","type","status","progress","video_id","params","result","error","cache_hit","poll_url","created_at","started_at","finished_at"],"additionalProperties":false}}}},"202":{"description":"Job accepted; poll `poll_url` until `status` is terminal.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["download","clip","frames"]},"status":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"progress":{"type":"number","minimum":0,"maximum":100,"description":"Percent complete."},"video_id":{"type":"string"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The normalised request body this job runs with."},"result":{"anyOf":[{"type":"object","properties":{"assets":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Direct download URL."},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mime":{"type":"string"},"filename":{"type":"string"},"cache_hit":{"type":"boolean","description":"True when the file already existed and nothing was downloaded."},"expires_at":{"description":"When `url` stops working. Re-fetch the job for a fresh URL.","anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"timestamp":{"description":"Frames only: the offset in seconds this image was taken at.","type":"number"}},"required":["url","bytes","mime","filename","cache_hit"],"additionalProperties":false}}},"required":["assets"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `succeeded`."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","validation_failed","not_found","video_unavailable","account_required","youtube_blocked","quota_exceeded","too_long","rate_limited","job_failed","internal"]},"message":{"type":"string"},"hint":{"type":"string"},"docs_url":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `failed`."},"cache_hit":{"type":"boolean","description":"True when the job was satisfied entirely from cache."},"poll_url":{"type":"string","description":"GET this (optionally with `?wait=30`) until `status` is terminal."},"created_at":{"type":"string","description":"ISO 8601 timestamp (UTC)."},"started_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]}},"required":["id","type","status","progress","video_id","params","result","error","cache_hit","poll_url","created_at","started_at","finished_at"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error — `error.code` is one of: `account_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error — `error.code` is one of: `video_unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Error — `error.code` is one of: `too_long`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/videos/{id}/clip":{"post":{"operationId":"createClip","summary":"Cut a section of a video (or its audio) between two timestamps","tags":["videos","jobs"],"x-scope":"pat","x-kind":"job","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"YouTube video id (e.g. `dQw4w9WgXcQ`) or a full YouTube URL, percent-encoded. The server resolves it to the canonical id.","schema":{"type":"string","minLength":1}},{"name":"wait","in":"query","required":false,"description":"Long-poll: hold the request up to this many seconds (0–60) until the job reaches a terminal status.","schema":{"default":0,"type":"integer","minimum":0,"maximum":60}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"start":{"description":"Time offset: seconds (`90`), `\"1:30\"` or `\"00:01:30.5\"`.","anyOf":[{"type":"number","minimum":0},{"type":"string","minLength":1}]},"end":{"description":"Time offset: seconds (`90`), `\"1:30\"` or `\"00:01:30.5\"`.","anyOf":[{"type":"number","minimum":0},{"type":"string","minLength":1}]},"kind":{"default":"video","description":"`video` (with audio) or `audio` only.","type":"string","enum":["video","audio"]},"format":{"description":"Container. Video: `mp4` (default) or `webm`. Audio: `mp3` (default), `wav`, `m4a`, `opus`.","type":"string","enum":["mp4","webm","mp3","wav","m4a","opus"]},"quality":{"default":"720p","description":"Video only. Max height; `best` is capped at 1080p. A lower available quality is used when the requested one does not exist.","type":"string","enum":["144p","240p","360p","480p","720p","1080p","best"]},"audio_bitrate":{"default":128,"description":"Audio only. Target bitrate in kbps (ignored for `wav`).","anyOf":[{"type":"number","const":64},{"type":"number","const":96},{"type":"number","const":128},{"type":"number","const":160},{"type":"number","const":192},{"type":"number","const":256},{"type":"number","const":320}]},"use_account":{"description":"true: use your connected YouTube account (result is private to you; `account_required` if none). false: never use it. Omitted: anonymous first, your account as fallback.","type":"boolean"}},"required":["start","end"]}}}},"responses":{"200":{"description":"The job was satisfied from cache, or finished within `wait`.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["download","clip","frames"]},"status":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"progress":{"type":"number","minimum":0,"maximum":100,"description":"Percent complete."},"video_id":{"type":"string"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The normalised request body this job runs with."},"result":{"anyOf":[{"type":"object","properties":{"assets":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Direct download URL."},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mime":{"type":"string"},"filename":{"type":"string"},"cache_hit":{"type":"boolean","description":"True when the file already existed and nothing was downloaded."},"expires_at":{"description":"When `url` stops working. Re-fetch the job for a fresh URL.","anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"timestamp":{"description":"Frames only: the offset in seconds this image was taken at.","type":"number"}},"required":["url","bytes","mime","filename","cache_hit"],"additionalProperties":false}}},"required":["assets"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `succeeded`."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","validation_failed","not_found","video_unavailable","account_required","youtube_blocked","quota_exceeded","too_long","rate_limited","job_failed","internal"]},"message":{"type":"string"},"hint":{"type":"string"},"docs_url":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `failed`."},"cache_hit":{"type":"boolean","description":"True when the job was satisfied entirely from cache."},"poll_url":{"type":"string","description":"GET this (optionally with `?wait=30`) until `status` is terminal."},"created_at":{"type":"string","description":"ISO 8601 timestamp (UTC)."},"started_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]}},"required":["id","type","status","progress","video_id","params","result","error","cache_hit","poll_url","created_at","started_at","finished_at"],"additionalProperties":false}}}},"202":{"description":"Job accepted; poll `poll_url` until `status` is terminal.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["download","clip","frames"]},"status":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"progress":{"type":"number","minimum":0,"maximum":100,"description":"Percent complete."},"video_id":{"type":"string"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The normalised request body this job runs with."},"result":{"anyOf":[{"type":"object","properties":{"assets":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Direct download URL."},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mime":{"type":"string"},"filename":{"type":"string"},"cache_hit":{"type":"boolean","description":"True when the file already existed and nothing was downloaded."},"expires_at":{"description":"When `url` stops working. Re-fetch the job for a fresh URL.","anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"timestamp":{"description":"Frames only: the offset in seconds this image was taken at.","type":"number"}},"required":["url","bytes","mime","filename","cache_hit"],"additionalProperties":false}}},"required":["assets"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `succeeded`."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","validation_failed","not_found","video_unavailable","account_required","youtube_blocked","quota_exceeded","too_long","rate_limited","job_failed","internal"]},"message":{"type":"string"},"hint":{"type":"string"},"docs_url":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `failed`."},"cache_hit":{"type":"boolean","description":"True when the job was satisfied entirely from cache."},"poll_url":{"type":"string","description":"GET this (optionally with `?wait=30`) until `status` is terminal."},"created_at":{"type":"string","description":"ISO 8601 timestamp (UTC)."},"started_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]}},"required":["id","type","status","progress","video_id","params","result","error","cache_hit","poll_url","created_at","started_at","finished_at"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error — `error.code` is one of: `account_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error — `error.code` is one of: `video_unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Error — `error.code` is one of: `too_long`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/videos/{id}/frames":{"post":{"operationId":"createFrames","summary":"Extract still images at the given timestamps","tags":["videos","jobs"],"x-scope":"pat","x-kind":"job","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"YouTube video id (e.g. `dQw4w9WgXcQ`) or a full YouTube URL, percent-encoded. The server resolves it to the canonical id.","schema":{"type":"string","minLength":1}},{"name":"wait","in":"query","required":false,"description":"Long-poll: hold the request up to this many seconds (0–60) until the job reaches a terminal status.","schema":{"default":0,"type":"integer","minimum":0,"maximum":60}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"timestamps":{"minItems":1,"maxItems":50,"type":"array","items":{"description":"Time offset: seconds (`90`), `\"1:30\"` or `\"00:01:30.5\"`.","anyOf":[{"type":"number","minimum":0},{"type":"string","minLength":1}]},"description":"Up to 50 time offsets; one image is produced per timestamp, in order."},"format":{"default":"jpg","type":"string","enum":["jpg","png"]},"width":{"description":"Resize to this width, preserving aspect ratio. Omit for source size.","type":"integer","minimum":16,"maximum":1920},"use_account":{"description":"true: use your connected YouTube account (result is private to you; `account_required` if none). false: never use it. Omitted: anonymous first, your account as fallback.","type":"boolean"}},"required":["timestamps"]}}}},"responses":{"200":{"description":"The job was satisfied from cache, or finished within `wait`.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["download","clip","frames"]},"status":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"progress":{"type":"number","minimum":0,"maximum":100,"description":"Percent complete."},"video_id":{"type":"string"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The normalised request body this job runs with."},"result":{"anyOf":[{"type":"object","properties":{"assets":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Direct download URL."},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mime":{"type":"string"},"filename":{"type":"string"},"cache_hit":{"type":"boolean","description":"True when the file already existed and nothing was downloaded."},"expires_at":{"description":"When `url` stops working. Re-fetch the job for a fresh URL.","anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"timestamp":{"description":"Frames only: the offset in seconds this image was taken at.","type":"number"}},"required":["url","bytes","mime","filename","cache_hit"],"additionalProperties":false}}},"required":["assets"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `succeeded`."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","validation_failed","not_found","video_unavailable","account_required","youtube_blocked","quota_exceeded","too_long","rate_limited","job_failed","internal"]},"message":{"type":"string"},"hint":{"type":"string"},"docs_url":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `failed`."},"cache_hit":{"type":"boolean","description":"True when the job was satisfied entirely from cache."},"poll_url":{"type":"string","description":"GET this (optionally with `?wait=30`) until `status` is terminal."},"created_at":{"type":"string","description":"ISO 8601 timestamp (UTC)."},"started_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]}},"required":["id","type","status","progress","video_id","params","result","error","cache_hit","poll_url","created_at","started_at","finished_at"],"additionalProperties":false}}}},"202":{"description":"Job accepted; poll `poll_url` until `status` is terminal.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["download","clip","frames"]},"status":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"progress":{"type":"number","minimum":0,"maximum":100,"description":"Percent complete."},"video_id":{"type":"string"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The normalised request body this job runs with."},"result":{"anyOf":[{"type":"object","properties":{"assets":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Direct download URL."},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mime":{"type":"string"},"filename":{"type":"string"},"cache_hit":{"type":"boolean","description":"True when the file already existed and nothing was downloaded."},"expires_at":{"description":"When `url` stops working. Re-fetch the job for a fresh URL.","anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"timestamp":{"description":"Frames only: the offset in seconds this image was taken at.","type":"number"}},"required":["url","bytes","mime","filename","cache_hit"],"additionalProperties":false}}},"required":["assets"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `succeeded`."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","validation_failed","not_found","video_unavailable","account_required","youtube_blocked","quota_exceeded","too_long","rate_limited","job_failed","internal"]},"message":{"type":"string"},"hint":{"type":"string"},"docs_url":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `failed`."},"cache_hit":{"type":"boolean","description":"True when the job was satisfied entirely from cache."},"poll_url":{"type":"string","description":"GET this (optionally with `?wait=30`) until `status` is terminal."},"created_at":{"type":"string","description":"ISO 8601 timestamp (UTC)."},"started_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]}},"required":["id","type","status","progress","video_id","params","result","error","cache_hit","poll_url","created_at","started_at","finished_at"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error — `error.code` is one of: `account_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error — `error.code` is one of: `video_unavailable`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Error — `error.code` is one of: `too_long`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/jobs":{"get":{"operationId":"listJobs","summary":"List your jobs, newest first","tags":["jobs"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]}},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["download","clip","frames"]}},{"name":"limit","in":"query","required":false,"description":"Max items to return (1–100).","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous response's `next_cursor`.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["download","clip","frames"]},"status":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"progress":{"type":"number","minimum":0,"maximum":100,"description":"Percent complete."},"video_id":{"type":"string"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The normalised request body this job runs with."},"result":{"anyOf":[{"type":"object","properties":{"assets":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Direct download URL."},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mime":{"type":"string"},"filename":{"type":"string"},"cache_hit":{"type":"boolean","description":"True when the file already existed and nothing was downloaded."},"expires_at":{"description":"When `url` stops working. Re-fetch the job for a fresh URL.","anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"timestamp":{"description":"Frames only: the offset in seconds this image was taken at.","type":"number"}},"required":["url","bytes","mime","filename","cache_hit"],"additionalProperties":false}}},"required":["assets"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `succeeded`."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","validation_failed","not_found","video_unavailable","account_required","youtube_blocked","quota_exceeded","too_long","rate_limited","job_failed","internal"]},"message":{"type":"string"},"hint":{"type":"string"},"docs_url":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `failed`."},"cache_hit":{"type":"boolean","description":"True when the job was satisfied entirely from cache."},"poll_url":{"type":"string","description":"GET this (optionally with `?wait=30`) until `status` is terminal."},"created_at":{"type":"string","description":"ISO 8601 timestamp (UTC)."},"started_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]}},"required":["id","type","status","progress","video_id","params","result","error","cache_hit","poll_url","created_at","started_at","finished_at"],"additionalProperties":false}},"next_cursor":{"description":"Pass as `cursor` to fetch the next page; null when there are no more.","type":["string","null"]}},"required":["jobs","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/jobs/{id}":{"get":{"operationId":"getJob","summary":"Job status and result","description":"`?wait=N` long-polls up to N seconds for a terminal status. A failed job is still a 200 — inspect `status` and `error`.","tags":["jobs"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Job id.","schema":{"type":"string","minLength":1}},{"name":"wait","in":"query","required":false,"description":"Long-poll: hold the request up to this many seconds (0–60) until the job reaches a terminal status.","schema":{"default":0,"type":"integer","minimum":0,"maximum":60}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["download","clip","frames"]},"status":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"progress":{"type":"number","minimum":0,"maximum":100,"description":"Percent complete."},"video_id":{"type":"string"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The normalised request body this job runs with."},"result":{"anyOf":[{"type":"object","properties":{"assets":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Direct download URL."},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mime":{"type":"string"},"filename":{"type":"string"},"cache_hit":{"type":"boolean","description":"True when the file already existed and nothing was downloaded."},"expires_at":{"description":"When `url` stops working. Re-fetch the job for a fresh URL.","anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"timestamp":{"description":"Frames only: the offset in seconds this image was taken at.","type":"number"}},"required":["url","bytes","mime","filename","cache_hit"],"additionalProperties":false}}},"required":["assets"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `succeeded`."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","validation_failed","not_found","video_unavailable","account_required","youtube_blocked","quota_exceeded","too_long","rate_limited","job_failed","internal"]},"message":{"type":"string"},"hint":{"type":"string"},"docs_url":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `failed`."},"cache_hit":{"type":"boolean","description":"True when the job was satisfied entirely from cache."},"poll_url":{"type":"string","description":"GET this (optionally with `?wait=30`) until `status` is terminal."},"created_at":{"type":"string","description":"ISO 8601 timestamp (UTC)."},"started_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]}},"required":["id","type","status","progress","video_id","params","result","error","cache_hit","poll_url","created_at","started_at","finished_at"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error — `error.code` is one of: `not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"operationId":"cancelJob","summary":"Cancel a queued or running job","description":"Idempotent: canceling a job that already finished returns it unchanged.","tags":["jobs"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"Job id.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["download","clip","frames"]},"status":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"progress":{"type":"number","minimum":0,"maximum":100,"description":"Percent complete."},"video_id":{"type":"string"},"params":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The normalised request body this job runs with."},"result":{"anyOf":[{"type":"object","properties":{"assets":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","description":"Direct download URL."},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mime":{"type":"string"},"filename":{"type":"string"},"cache_hit":{"type":"boolean","description":"True when the file already existed and nothing was downloaded."},"expires_at":{"description":"When `url` stops working. Re-fetch the job for a fresh URL.","anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"timestamp":{"description":"Frames only: the offset in seconds this image was taken at.","type":"number"}},"required":["url","bytes","mime","filename","cache_hit"],"additionalProperties":false}}},"required":["assets"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `succeeded`."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","validation_failed","not_found","video_unavailable","account_required","youtube_blocked","quota_exceeded","too_long","rate_limited","job_failed","internal"]},"message":{"type":"string"},"hint":{"type":"string"},"docs_url":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}],"description":"Set when `status` is `failed`."},"cache_hit":{"type":"boolean","description":"True when the job was satisfied entirely from cache."},"poll_url":{"type":"string","description":"GET this (optionally with `?wait=30`) until `status` is terminal."},"created_at":{"type":"string","description":"ISO 8601 timestamp (UTC)."},"started_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]}},"required":["id","type","status","progress","video_id","params","result","error","cache_hit","poll_url","created_at","started_at","finished_at"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error — `error.code` is one of: `not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/me":{"get":{"operationId":"getMe","summary":"The account and token behind this request, plus its limits","tags":["me"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":["string","null"]},"role":{"type":"string","enum":["user","admin"]},"daily_quota":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","description":"ISO 8601 timestamp (UTC)."}},"required":["id","email","role","daily_quota","created_at"],"additionalProperties":false},"token":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string","description":"ISO 8601 timestamp (UTC)."},"last_used_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]}},"required":["id","name","created_at","last_used_at"],"additionalProperties":false},"youtube_account":{"type":"object","properties":{"connected":{"type":"boolean"},"label":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["active","invalid","disabled"]},{"type":"null"}],"description":"`invalid` means the cookies expired or were rejected — upload fresh ones."},"last_used_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"connected_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]}},"required":["connected","label","status","last_used_at","connected_at"],"additionalProperties":false},"limits":{"type":"object","properties":{"max_duration_seconds":{"type":"number"},"max_video_quality":{"type":"string"},"default_video_quality":{"type":"string"},"max_concurrent_jobs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"max_wait_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["max_duration_seconds","max_video_quality","default_video_quality","max_concurrent_jobs","max_wait_seconds"],"additionalProperties":false}},"required":["account","token","youtube_account","limits"],"additionalProperties":false}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/me/usage":{"get":{"operationId":"getMyUsage","summary":"Request, cache-hit and byte counts, and remaining daily quota","tags":["me"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"days","in":"query","required":false,"description":"How many days of history to return.","schema":{"default":30,"type":"integer","minimum":1,"maximum":90}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"today":{"type":"object","properties":{"requests":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cache_hits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"quota_limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"quota_remaining":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"resets_at":{"type":"string","description":"ISO 8601 timestamp (UTC)."}},"required":["requests","cache_hits","bytes","quota_limit","quota_remaining","resets_at"],"additionalProperties":false},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"YYYY-MM-DD (UTC)."},"requests":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cache_hits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["date","requests","cache_hits","bytes"],"additionalProperties":false}},"by_operation":{"type":"array","items":{"type":"object","properties":{"operation_id":{"type":"string"},"requests":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cache_hits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["operation_id","requests","cache_hits","bytes"],"additionalProperties":false}}},"required":["today","daily","by_operation"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/me/youtube-account":{"get":{"operationId":"getYoutubeAccount","summary":"Whether a YouTube account is connected","tags":["me"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"connected":{"type":"boolean"},"label":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["active","invalid","disabled"]},{"type":"null"}],"description":"`invalid` means the cookies expired or were rejected — upload fresh ones."},"last_used_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"connected_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]}},"required":["connected","label","status","last_used_at","connected_at"],"additionalProperties":false}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"put":{"operationId":"putYoutubeAccount","summary":"Connect (or replace) your YouTube account from cookies.txt","description":"Cookies are encrypted at rest and never returned by any endpoint.","tags":["me"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cookies":{"type":"string","minLength":1,"maxLength":524288,"description":"Contents of a Netscape-format cookies.txt exported from a logged-in youtube.com session. Stored encrypted; never returned."},"label":{"description":"Free-form name for this account.","type":"string","maxLength":100}},"required":["cookies"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"connected":{"type":"boolean"},"label":{"type":["string","null"]},"status":{"anyOf":[{"type":"string","enum":["active","invalid","disabled"]},{"type":"null"}],"description":"`invalid` means the cookies expired or were rejected — upload fresh ones."},"last_used_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"connected_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]}},"required":["connected","label","status","last_used_at","connected_at"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"operationId":"deleteYoutubeAccount","summary":"Disconnect your YouTube account and delete its cookies","tags":["me"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"],"additionalProperties":false}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/me/playlists":{"get":{"operationId":"listMyPlaylists","summary":"Playlists of the connected YouTube account","tags":["me"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Max items to return (1–100).","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous response's `next_cursor`.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"playlists":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"title":{"type":"string"},"channel":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"name":{"type":["string","null"]},"handle":{"type":["string","null"]},"url":{"type":["string","null"]}},"required":["id","name","handle","url"],"additionalProperties":false},{"type":"null"}]},"video_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"thumbnail_url":{"type":["string","null"]}},"required":["id","url","title","channel","video_count","thumbnail_url"],"additionalProperties":false}},"next_cursor":{"description":"Pass as `cursor` to fetch the next page; null when there are no more.","type":["string","null"]}},"required":["playlists","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error — `error.code` is one of: `account_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/me/subscriptions":{"get":{"operationId":"listMySubscriptions","summary":"Channels the connected YouTube account subscribes to","tags":["me"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Max items to return (1–100).","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous response's `next_cursor`.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"handle":{"type":["string","null"]},"name":{"type":"string"},"description":{"type":["string","null"]},"subscriber_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"thumbnail_url":{"type":["string","null"]}},"required":["id","url","handle","name","description","subscriber_count","thumbnail_url"],"additionalProperties":false}},"next_cursor":{"description":"Pass as `cursor` to fetch the next page; null when there are no more.","type":["string","null"]}},"required":["channels","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error — `error.code` is one of: `account_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/me/liked":{"get":{"operationId":"listMyLiked","summary":"Videos the connected YouTube account liked","tags":["me"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Max items to return (1–100).","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous response's `next_cursor`.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"videos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"title":{"type":"string"},"duration_seconds":{"type":["number","null"]},"channel":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"name":{"type":["string","null"]},"handle":{"type":["string","null"]},"url":{"type":["string","null"]}},"required":["id","name","handle","url"],"additionalProperties":false},{"type":"null"}]},"thumbnail_url":{"type":["string","null"]},"view_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"published_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"is_live":{"type":["boolean","null"]}},"required":["id","url","title","duration_seconds","channel","thumbnail_url","view_count","published_at"],"additionalProperties":false}},"next_cursor":{"description":"Pass as `cursor` to fetch the next page; null when there are no more.","type":["string","null"]}},"required":["videos","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error — `error.code` is one of: `account_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/me/watch-later":{"get":{"operationId":"listMyWatchLater","summary":"The connected YouTube account's Watch Later list","tags":["me"],"x-scope":"pat","x-kind":"sync","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Max items to return (1–100).","schema":{"default":20,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from a previous response's `next_cursor`.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"videos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"title":{"type":"string"},"duration_seconds":{"type":["number","null"]},"channel":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"name":{"type":["string","null"]},"handle":{"type":["string","null"]},"url":{"type":["string","null"]}},"required":["id","name","handle","url"],"additionalProperties":false},{"type":"null"}]},"thumbnail_url":{"type":["string","null"]},"view_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"published_at":{"anyOf":[{"type":"string","description":"ISO 8601 timestamp (UTC)."},{"type":"null"}]},"is_live":{"type":["boolean","null"]}},"required":["id","url","title","duration_seconds","channel","thumbnail_url","view_count","published_at"],"additionalProperties":false}},"next_cursor":{"description":"Pass as `cursor` to fetch the next page; null when there are no more.","type":["string","null"]}},"required":["videos","next_cursor"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Error — `error.code` is one of: `unauthorized`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Error — `error.code` is one of: `account_required`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `quota_exceeded`, `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"Error — `error.code` is one of: `youtube_blocked`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/cli/device":{"post":{"operationId":"startDeviceLogin","summary":"Begin CLI login: get a user code to approve in the browser","tags":["auth"],"x-scope":"public","x-kind":"sync","security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_name":{"description":"Shown on the approval page and used as the token name, e.g. the hostname.","type":"string","maxLength":100}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"user_code":{"type":"string","description":"Short code the user confirms in the browser."},"poll_token":{"type":"string","description":"Secret; send to the poll endpoint. Never show it to the user."},"verification_url":{"type":"string"},"verification_url_complete":{"type":"string","description":"`verification_url` with the code pre-filled."},"expires_in":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Seconds until this request expires."},"interval":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Minimum seconds between polls."}},"required":["user_code","poll_token","verification_url","verification_url_complete","expires_in","interval"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/v1/cli/device/token":{"post":{"operationId":"pollDeviceLogin","summary":"Poll a CLI login; returns the token once approved","tags":["auth"],"x-scope":"public","x-kind":"sync","security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"poll_token":{"type":"string","minLength":1}},"required":["poll_token"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["pending","approved","denied","expired"]},"token":{"description":"The new `ayt_pat_…` token. Returned exactly once, on the first poll after approval.","type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":["string","null"]}},"required":["id","email"],"additionalProperties":false}},"required":["status"],"additionalProperties":false}}}},"400":{"description":"Error — `error.code` is one of: `validation_failed`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Error — `error.code` is one of: `not_found`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Error — `error.code` is one of: `rate_limited`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Error — `error.code` is one of: `internal`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Personal access token (`ayt_pat_…`)."}},"schemas":{"ErrorEnvelope":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","validation_failed","not_found","video_unavailable","account_required","youtube_blocked","quota_exceeded","too_long","rate_limited","job_failed","internal"]},"message":{"type":"string"},"hint":{"type":"string"},"docs_url":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}