{"openapi":"3.0.3","info":{"title":"CaptionPass HTTP API","version":"1.0.0","description":"Bearer-authenticated caption QA API for Free+ and Pro accounts. Human-readable reference: /docs/api","contact":{"name":"CaptionPass","url":"https://stage.captionpass.com/docs/api","email":"support@captionpass.com"}},"servers":[{"url":"https://stage.captionpass.com","description":"CaptionPass production"}],"tags":[{"name":"Process","description":"Multipart caption processing"},{"name":"ExplainAI","description":"AI editorial plan and client handoff copy"},{"name":"Account","description":"Profile and usage"},{"name":"API keys","description":"Key management"},{"name":"Webhooks","description":"Pro export webhooks"},{"name":"Custom exports","description":"CPES templates (Pro)"},{"name":"Projects","description":"Project listing for CPES test"},{"name":"Drift","description":"Caption version diff (caption_drift add-on)"},{"name":"Video","description":"Media upload, extract/render jobs, artifacts (caption_extract / caption_render)"}],"paths":{"/api/v1/process":{"post":{"operationId":"processCaption","summary":"Process caption file (multipart)","tags":["Process"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Processed captions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessSuccess"}}}},"400":{"description":"Invalid JSON, bad preset, invalid script, missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Declared Content-Length or file too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Parse/rule failure on process or export test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"SRT, VTT, SBV, ASS, TTML, or JSON IR"},"preset":{"type":"string","enum":["youtube","tiktok","html5","generic","lms","instagram-reels","linkedin","vimeo","facebook","zoom","developer-json"],"default":"youtube"},"fixProfile":{"type":"string","enum":["warn-only","layout-preserve-breaks","auto-split-sentences","auto-split-cps"]},"includeExplain":{"type":"boolean","default":false,"description":"When true, attach ExplainAI v3 JSON if entitled and quota allows"}}}}}}}},"/api/v1/explain":{"post":{"operationId":"explainCaptionReport","summary":"ExplainAI editorial plan for a process report","tags":["ExplainAI"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"ExplainAI editorial plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExplainResponseV3"}}}},"400":{"description":"Invalid JSON, bad preset, invalid script, missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"report":{"type":"object","description":"Upload-ready pipeline report"},"aidedReport":{"type":"object"},"aidedSameAsDelivery":{"type":"boolean"},"aidedOutput":{"type":"string"},"cues":{"type":"array","items":{"type":"object"}}}}}}}}},"/api/v1/me":{"get":{"operationId":"getMe","summary":"Account profile and entitlements","tags":["Account"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid JSON, bad preset, invalid script, missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/usage":{"get":{"operationId":"getUsage","summary":"Daily usage snapshot","tags":["Account"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid JSON, bad preset, invalid script, missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/api-keys":{"get":{"operationId":"listApiKeys","summary":"List API keys (masked)","tags":["API keys"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid JSON, bad preset, invalid script, missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"createApiKey","summary":"Create API key (one-time secret)","tags":["API keys"],"security":[{"BearerAuth":[]}],"responses":{"201":{"description":"Key created with one-time secret","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid JSON, bad preset, invalid script, missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v1/api-keys/{keyId}":{"delete":{"operationId":"deleteApiKey","summary":"Revoke API key","tags":["API keys"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid JSON, bad preset, invalid script, missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/webhook":{"get":{"operationId":"getWebhook","summary":"Webhook config (masked secret)","tags":["Webhooks"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid JSON, bad preset, invalid script, missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"operationId":"putWebhook","summary":"Update webhook URL","tags":["Webhooks"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Webhook updated","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid JSON, bad preset, invalid script, missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"HTTPS webhook URL"},"enabled":{"type":"boolean"},"rotateSecret":{"type":"boolean"}}}}}}}},"/api/v1/projects":{"get":{"operationId":"listProjects","summary":"List projects for CPES test","tags":["Projects"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid JSON, bad preset, invalid script, missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/projects/{id}/diff":{"post":{"operationId":"diffProjectIr","summary":"Compare stored project IR against candidate IR (caption drift)","tags":["Drift"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Cue diff summary and preview","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DriftDiffResponse"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Parse/rule failure on process or export test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ir":{"type":"string","description":"Candidate IR JSON string"},"afterIr":{"type":"string","description":"Alias for ir"}}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/media/upload":{"post":{"operationId":"initiateMediaUpload","summary":"Presigned upload for project source media","tags":["Video"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Upload session","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid"},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer"},"urlTtlSeconds":{"type":"integer"}}}}}}}},"/api/v1/media/upload/{uploadId}/complete":{"post":{"operationId":"completeMediaUpload","summary":"Finalize media upload and set 24h retention","tags":["Video"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Upload session","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"parameters":[{"name":"uploadId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid"},"objectKey":{"type":"string"},"multipart":{"type":"boolean"},"parts":{"type":"array","items":{"type":"object"}}}}}}}}},"/api/v1/export-templates":{"get":{"operationId":"listExportTemplates","summary":"List export templates","tags":["Custom exports"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid JSON, bad preset, invalid script, missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Parse/rule failure on process or export test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"createExportTemplate","summary":"Create export template","tags":["Custom exports"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid JSON, bad preset, invalid script, missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Parse/rule failure on process or export test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"scriptSource":{"type":"string"}}}}}}}},"/api/v1/export-templates/validate":{"post":{"operationId":"validateExportScript","summary":"CPES validate / test / both","tags":["Custom exports"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid JSON, bad preset, invalid script, missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Parse/rule failure on process or export test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scriptSource":{"type":"string"},"mode":{"type":"string","enum":["validate","test","both"]},"projectId":{"type":"string","format":"uuid"}}}}}}}},"/api/v1/export-templates/{id}":{"get":{"operationId":"getExportTemplate","summary":"Get export template","tags":["Custom exports"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid JSON, bad preset, invalid script, missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Parse/rule failure on process or export test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"put":{"operationId":"updateExportTemplate","summary":"Update export template","tags":["Custom exports"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid JSON, bad preset, invalid script, missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Parse/rule failure on process or export test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"scriptSource":{"type":"string"},"revision":{"type":"integer"}}}}}}},"delete":{"operationId":"deleteExportTemplate","summary":"Delete export template","tags":["Custom exports"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid JSON, bad preset, invalid script, missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Parse/rule failure on process or export test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/export-templates/{id}/test":{"post":{"operationId":"testExportTemplate","summary":"CPES test on project IR","tags":["Custom exports"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid JSON, bad preset, invalid script, missing fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Parse/rule failure on process or export test.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid"},"mode":{"type":"string","enum":["validate","test","both"]}}}}}}}},"/api/v1/jobs/extract":{"post":{"operationId":"createExtractJob","summary":"Enqueue caption extract job from project media","tags":["Video"],"security":[{"BearerAuth":[]}],"responses":{"202":{"description":"Job queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoJobCreated"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid"},"extractMode":{"type":"string","enum":["soft_track","broadcast_cc","ocr_burned"]},"trackIndex":{"type":"integer"},"mediaObjectKey":{"type":"string"}}}}}}}},"/api/v1/jobs/render":{"post":{"operationId":"createRenderJob","summary":"Enqueue mux/burn/sidecar render job","tags":["Video"],"security":[{"BearerAuth":[]}],"responses":{"202":{"description":"Job queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoJobCreated"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid"},"mode":{"type":"string","enum":["sidecar","mux_soft","burn_in"]},"preset":{"type":"string"},"outputDelivery":{"type":"string","enum":["inline","url"]},"mediaObjectKey":{"type":"string"}}}}}}}},"/api/v1/jobs/{jobId}":{"get":{"operationId":"getVideoJob","summary":"Poll async video/extract/render job status","tags":["Video"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Job status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoJobStatus"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]},"delete":{"operationId":"cancelVideoJob","summary":"Cancel a queued video job","tags":["Video"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Job status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoJobStatus"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}]}},"/api/v1/artifacts/{artifactId}":{"get":{"operationId":"getVideoArtifact","summary":"Refresh presigned download URL for render artifact","tags":["Video"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Presigned artifact download URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactUrlResponse"}}}},"401":{"description":"Missing/invalid Bearer, unknown or revoked key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing scope, missing entitlement (e.g. Pro workspace), or V1_API disabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Per-key burst or export-operation burst exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Backing store or WASM runtime not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"parameters":[{"name":"artifactId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"ttlSeconds","in":"query","schema":{"type":"integer","minimum":60,"maximum":86400}}]}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"cp_live_…","description":"API key from Dashboard → Account → API keys"}},"schemas":{"ApiError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","enum":["unauthorized","forbidden","rate_limited","quota_exceeded","bad_request","payload_too_large","payload_too_large","processing_failed","not_implemented","unavailable"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}},"ProcessSuccess":{"type":"object","properties":{"report":{"type":"object","description":"Diagnostic report"},"output":{"type":"string","description":"Delivery caption file body"},"aidedOutput":{"type":"string"},"aidedReport":{"type":"object"},"suggestions":{"type":"array","items":{"type":"object"}},"aidedSameAsDelivery":{"type":"boolean"},"deliveryStatus":{"type":"string","enum":["ready","will_adapt","needs_attention"]},"aidedStatus":{"type":"string","enum":["ready","will_adapt","needs_attention"]},"remainingApiRunsToday":{"type":"integer"},"explainAvailable":{"type":"boolean"},"explain":{"$ref":"#/components/schemas/ExplainResponseV3"},"explainSkippedReason":{"type":"string","enum":["not_entitled","not_configured","quota_exceeded"]}}},"ExplainResponseV3":{"type":"object","required":["format","status","actions"],"properties":{"format":{"type":"string","enum":["cp.explain/v3"]},"status":{"type":"string","enum":["actions","clear"]},"headline":{"type":"string"},"message":{"type":"string"},"clientSummary":{"type":"string"},"platformNotes":{"type":"string"},"deliveryComparison":{"type":"object","properties":{"uploadReadyScore":{"type":"number"},"enhancedScore":{"type":"number"},"summary":{"type":"string"}}},"actions":{"type":"array","items":{"type":"object"}},"alreadyFixedSummary":{"type":"string"}}},"DriftDiffResponse":{"type":"object","properties":{"summary":{"type":"object","properties":{"added":{"type":"integer"},"removed":{"type":"integer"},"changed":{"type":"integer"}}},"preview":{"type":"array","items":{"type":"object"}},"truncated":{"type":"boolean"},"currentIrRevision":{"type":"integer"}}},"VideoJobCreated":{"type":"object","properties":{"jobId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued"]},"kind":{"type":"string","enum":["extract","render"]},"estimatedWaitSeconds":{"type":"integer"}}},"VideoJobStatus":{"type":"object","properties":{"job":{"type":"object","additionalProperties":true}}},"ArtifactUrlResponse":{"type":"object","properties":{"artifactId":{"type":"string"},"url":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer"}}},"ExportWebhookPayload":{"type":"object","properties":{"event":{"type":"string","enum":["export_complete"]},"receipt":{"type":"object","properties":{"version":{"type":"integer"},"kind":{"type":"string"},"projectId":{"type":"string"},"irRevision":{"type":"integer"},"artifacts":{"type":"array","items":{"type":"object","properties":{"preset":{"type":"string"},"exportId":{"type":"string"},"filename":{"type":"string"}}}}}}}}}},"x-webhook-signature":{"header":"X-CaptionPass-Signature","algorithm":"HMAC-SHA256","description":"Hex digest of raw request body using webhook secret from Account → Export webhooks"}}