{"servers":[{"url":"https://api.captionbolt.com"}],"info":{"title":"CaptionBolt API","version":"1.0.0","description":"API keys, account quotas, durable commands and 14-day projects. Mutating upload/project/export/retry requests require Idempotency-Key. Video bytes upload directly to R2."},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"CaptionBolt API key"}}},"security":[{"apiKey":[]}],"openapi":"3.1.1","paths":{"/v1/account":{"get":{"operationId":"account","tags":["Account"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"object","properties":{"totalCreditsSec":{"type":"number"},"usedCreditsSec":{"type":"number"},"reservedCreditsSec":{"type":"number"},"availableCreditsSec":{"type":"number"},"periodStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"periodEnd":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["totalCreditsSec","usedCreditsSec","reservedCreditsSec","availableCreditsSec","periodStart","periodEnd"]},"upload":{"type":"object","properties":{"maxFileSizeBytes":{"type":"number"},"maxDurationSec":{"type":"number"}},"required":["maxFileSizeBytes","maxDurationSec"]},"outputFormats":{"type":"array","items":{"enum":["mp4","srt","vtt","ass","txt"],"type":"string"}},"maxConcurrentJobs":{"type":"number"},"watermark":{"type":"boolean"},"projectAccessDays":{"type":"number"}},"required":["credits","upload","outputFormats","maxConcurrentJobs","watermark","projectAccessDays"]}}}}}}},"/v1/styles":{"get":{"operationId":"styles","tags":["Styles"],"parameters":[{"name":"search","in":"query","schema":{"type":"string","maxLength":200},"allowEmptyValue":true,"allowReserved":true},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":100000,"default":0},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"recommended":{"type":"boolean"}},"required":["id","name","description","category","tags","recommended"]}},"total":{"type":"number"}},"required":["items","total"]}}}}}}},"/v1/presets":{"get":{"operationId":"presets","tags":["Presets"],"parameters":[{"name":"search","in":"query","schema":{"type":"string","maxLength":200},"allowEmptyValue":true,"allowReserved":true},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":100000,"default":0},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"total":{"type":"number"}},"required":["items","total"]}}}}}}},"/v1/operations/{id}":{"get":{"operationId":"operation","tags":["Operations"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceId":{"type":"string"},"state":{"enum":["pending","running","completed","failed"],"type":"string"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"pollAfterSeconds":{"type":"number"}},"required":["id","resourceId","state","error","pollAfterSeconds"]}}}}}}},"/v1/uploads":{"post":{"operationId":"createUpload","tags":["Uploads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":512},"fileSize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"lastModifiedMs":{"type":"integer","minimum":0,"maximum":9007199254740991},"fingerprint":{"type":"string","pattern":"^[a-f0-9]{64}$"},"durationSec":{"type":"number","exclusiveMinimum":0},"contentType":{"enum":["video/mp4","video/quicktime","video/webm","video/x-msvideo"],"type":"string"}},"required":["fileName","fileSize","lastModifiedMs","fingerprint","contentType"],"additionalProperties":false}}}},"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceId":{"type":"string"},"state":{"enum":["pending","running","completed","failed"],"type":"string"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"pollAfterSeconds":{"type":"number"}},"required":["id","resourceId","state","error","pollAfterSeconds"]}}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"Reuse for the same request; a different request with this key returns 409."}]}},"/v1/uploads/{uploadId}":{"get":{"operationId":"getUpload","tags":["Uploads"],"parameters":[{"name":"uploadId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"status":{"enum":["pending","uploading","completing","uploaded","consumed","aborted","expired"],"type":"string"},"fileName":{"type":"string"},"fileSize":{"type":"number"},"contentType":{"type":"string"},"lastModifiedMs":{"type":"number"},"fingerprint":{"type":"string"},"partSize":{"type":"number"},"partCount":{"type":"number"},"completedPartNumbers":{"type":"array","items":{"type":"number"}},"expiresAt":{"type":"string"}},"required":["id","projectId","status","fileName","fileSize","contentType","lastModifiedMs","fingerprint","partSize","partCount","completedPartNumbers","expiresAt"]}}}}}},"delete":{"operationId":"abortUpload","tags":["Uploads"],"parameters":[{"name":"uploadId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/v1/uploads/{uploadId}/resume":{"post":{"operationId":"resumeUpload","tags":["Uploads"],"parameters":[{"name":"uploadId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"status":{"enum":["pending","uploading","completing","uploaded","consumed","aborted","expired"],"type":"string"},"fileName":{"type":"string"},"fileSize":{"type":"number"},"contentType":{"type":"string"},"lastModifiedMs":{"type":"number"},"fingerprint":{"type":"string"},"partSize":{"type":"number"},"partCount":{"type":"number"},"completedPartNumbers":{"type":"array","items":{"type":"number"}},"expiresAt":{"type":"string"}},"required":["id","projectId","status","fileName","fileSize","contentType","lastModifiedMs","fingerprint","partSize","partCount","completedPartNumbers","expiresAt"]}}}}}}},"/v1/uploads/{uploadId}/parts":{"post":{"operationId":"signParts","tags":["Uploads"],"parameters":[{"name":"uploadId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"partNumbers":{"type":"array","minItems":1,"maxItems":32,"items":{"type":"integer","minimum":1,"maximum":10000}}},"required":["partNumbers"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"completedPartNumbers":{"type":"array","items":{"type":"number"}},"signedParts":{"type":"array","items":{"type":"object","properties":{"partNumber":{"type":"number"},"contentLength":{"type":"number"},"url":{"type":"string","format":"uri"}},"required":["partNumber","contentLength","url"]}}},"required":["completedPartNumbers","signedParts"]}}}}}}},"/v1/uploads/{uploadId}/complete":{"post":{"operationId":"completeUpload","tags":["Uploads"],"parameters":[{"name":"uploadId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"status":{"enum":["pending","uploading","completing","uploaded","consumed","aborted","expired"],"type":"string"},"fileName":{"type":"string"},"fileSize":{"type":"number"},"contentType":{"type":"string"},"lastModifiedMs":{"type":"number"},"fingerprint":{"type":"string"},"partSize":{"type":"number"},"partCount":{"type":"number"},"completedPartNumbers":{"type":"array","items":{"type":"number"}},"expiresAt":{"type":"string"}},"required":["id","projectId","status","fileName","fileSize","contentType","lastModifiedMs","fingerprint","partSize","partCount","completedPartNumbers","expiresAt"]}}}}}}},"/v1/projects":{"post":{"operationId":"createProject","tags":["Projects"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"uploadSessionId":{"type":"string","format":"uuid"},"language":{"type":"string","minLength":2,"maxLength":5},"styleId":{"type":"string","minLength":1,"maxLength":100},"presetId":{"type":"string","minLength":1,"maxLength":100},"mode":{"enum":["review","auto-export"],"type":"string","default":"review"}},"required":["uploadSessionId"],"additionalProperties":false}}}},"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceId":{"type":"string"},"state":{"enum":["pending","running","completed","failed"],"type":"string"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"pollAfterSeconds":{"type":"number"}},"required":["id","resourceId","state","error","pollAfterSeconds"]}}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"Reuse for the same request; a different request with this key returns 409."}]},"get":{"operationId":"listProjects","tags":["Projects"],"parameters":[{"name":"search","in":"query","schema":{"type":"string","maxLength":200},"allowEmptyValue":true,"allowReserved":true},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":100000,"default":0},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["processing","ready","exporting","completed","failed","cancelled"],"type":"string"},"progress":{"type":"number"},"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"pollAfterSeconds":{"type":"number"},"autoExport":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"resourceId":{"type":"string"},"state":{"enum":["pending","running","completed","failed"],"type":"string"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"pollAfterSeconds":{"type":"number"}},"required":["id","resourceId","state","error","pollAfterSeconds"]},{"type":"null"}]}},"required":["id","fileName","status","progress","createdAt","expiresAt","error","pollAfterSeconds"]}},"total":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["items","total"]}}}}}}},"/v1/projects/{projectId}":{"get":{"operationId":"getProject","tags":["Projects"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["processing","ready","exporting","completed","failed","cancelled"],"type":"string"},"progress":{"type":"number"},"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"pollAfterSeconds":{"type":"number"},"autoExport":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"resourceId":{"type":"string"},"state":{"enum":["pending","running","completed","failed"],"type":"string"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"pollAfterSeconds":{"type":"number"}},"required":["id","resourceId","state","error","pollAfterSeconds"]},{"type":"null"}]}},"required":["id","fileName","status","progress","createdAt","expiresAt","error","pollAfterSeconds"]}}}}}}},"/v1/projects/{projectId}/status":{"get":{"operationId":"projectStatus","tags":["Projects"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["processing","ready","exporting","completed","failed","cancelled"],"type":"string"},"progress":{"type":"number"},"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"pollAfterSeconds":{"type":"number"},"autoExport":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"resourceId":{"type":"string"},"state":{"enum":["pending","running","completed","failed"],"type":"string"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"pollAfterSeconds":{"type":"number"}},"required":["id","resourceId","state","error","pollAfterSeconds"]},{"type":"null"}]}},"required":["id","fileName","status","progress","createdAt","expiresAt","error","pollAfterSeconds"]}}}}}}},"/v1/projects/{projectId}/export":{"post":{"operationId":"exportProject","tags":["Projects"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"Reuse for the same request; a different request with this key returns 409."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"outputFormats":{"type":"array","minItems":1,"maxItems":5,"items":{"enum":["mp4","srt","vtt","ass","txt"],"type":"string"},"default":["mp4","srt","vtt","ass","txt"]}},"additionalProperties":false}}}},"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceId":{"type":"string"},"state":{"enum":["pending","running","completed","failed"],"type":"string"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"pollAfterSeconds":{"type":"number"}},"required":["id","resourceId","state","error","pollAfterSeconds"]}}}}}}},"/v1/projects/{projectId}/retry":{"post":{"operationId":"retryProject","tags":["Projects"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"Reuse for the same request; a different request with this key returns 409."}],"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceId":{"type":"string"},"state":{"enum":["pending","running","completed","failed"],"type":"string"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"pollAfterSeconds":{"type":"number"}},"required":["id","resourceId","state","error","pollAfterSeconds"]}}}}}}},"/v1/projects/{projectId}/cancel":{"post":{"operationId":"cancelProject","tags":["Projects"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"Reuse for the same request; a different request with this key returns 409."}],"responses":{"202":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"resourceId":{"type":"string"},"state":{"enum":["pending","running","completed","failed"],"type":"string"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"pollAfterSeconds":{"type":"number"}},"required":["id","resourceId","state","error","pollAfterSeconds"]}}}}}}},"/v1/projects/{projectId}/result":{"get":{"operationId":"result","tags":["Projects"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"format":{"enum":["mp4","srt","vtt","ass","txt"],"type":"string"},"url":{"type":"string","format":"uri"}},"required":["format","url"]}},"expiresAt":{"type":"string"}},"required":["projectId","files","expiresAt"]}}}}}}},"/v1/webhooks":{"get":{"operationId":"listWebhooks","tags":["Webhooks"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"}},"required":["id","url","events","enabled","createdAt"]}}}}}}},"post":{"operationId":"createWebhook","tags":["Webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"events":{"type":"array","minItems":1,"maxItems":4,"items":{"enum":["project.ready","project.completed","project.failed","project.cancelled"],"type":"string"},"default":["project.completed","project.failed"]}},"required":["url"],"additionalProperties":false}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"secret":{"type":"string"}},"required":["id","secret"]}}}}}}},"/v1/webhooks/{webhookId}":{"get":{"operationId":"getWebhook","tags":["Webhooks"],"parameters":[{"name":"webhookId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"}},"required":["id","url","events","enabled","createdAt"]}}}}}},"patch":{"operationId":"updateWebhook","tags":["Webhooks"],"parameters":[{"name":"webhookId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"events":{"type":"array","minItems":1,"maxItems":4,"items":{"enum":["project.ready","project.completed","project.failed","project.cancelled"],"type":"string"}},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"]}}}}}},"delete":{"operationId":"deleteWebhook","tags":["Webhooks"],"parameters":[{"name":"webhookId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/v1/webhooks/{webhookId}/rotate-secret":{"post":{"operationId":"rotateWebhook","tags":["Webhooks"],"parameters":[{"name":"webhookId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"secret":{"type":"string"}},"required":["id","secret"]}}}}}}},"/v1/webhooks/{webhookId}/test":{"post":{"operationId":"testWebhook","tags":["Webhooks"],"parameters":[{"name":"webhookId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"]}}}}}}},"/v1/webhooks/{webhookId}/deliveries":{"get":{"operationId":"webhookDeliveries","tags":["Webhooks"],"parameters":[{"name":"webhookId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":100000,"default":0},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventId":{"type":"string"},"type":{"type":"string"},"state":{"type":"string"},"attempts":{"type":"number"},"statusCode":{"anyOf":[{"type":"number"},{"type":"null"}]},"errorCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"nextAttemptAt":{"type":"string","format":"date-time","x-native-type":"date"},"finishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]}},"required":["id","eventId","type","state","attempts","statusCode","errorCode","createdAt","nextAttemptAt","finishedAt"]}}}}}}}},"/v1/webhooks/{webhookId}/deliveries/{id}/retry":{"post":{"operationId":"retryDelivery","tags":["Webhooks"],"parameters":[{"name":"webhookId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"]}}}}}}}}}