{"openapi":"3.1.0","info":{"title":"AI Hero Draft Course Sync Control Plane","version":"1.0.0","description":"Draft-only control plane. Target product, workshop, section, lesson, visibility, and relation IDs are server-owned."},"servers":[{"url":"https://www.aihero.dev"}],"paths":{"/v1/course-sync/bindings/{bindingId}":{"get":{"operationId":"getSyncBinding","security":[{"ReadBearer":[]}],"parameters":[{"name":"bindingId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Redacted immutable binding assertion","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncBinding"}}}}}}},"/v1/course-sync/bindings/{bindingId}/runs:stage":{"post":{"operationId":"stageSourceRevision","security":[{"StageBearer":[]}],"parameters":[{"name":"bindingId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["manifest"],"properties":{"manifest":{"$ref":"#/components/schemas/CourseJsonV3"}}}}}},"responses":{"201":{"description":"Redacted sync run receipt","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRun"}}}},"409":{"description":"Scope or idempotency conflict"}}}},"/v1/course-sync/runs/{runId}:preview":{"post":{"operationId":"previewSyncRun","security":[{"WorkerBearer":[]}],"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Redacted sync run receipt","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRun"}}}}}}},"/v1/course-sync/runs/{runId}":{"get":{"operationId":"getSyncRun","security":[{"ReadBearer":[]}],"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Redacted sync run receipt","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRun"}}}}}}},"/v1/course-sync/runs/{runId}:apply":{"post":{"operationId":"applyStagedSyncRun","security":[{"WorkerBearer":[]}],"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Redacted sync run receipt","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRun"}}}}}}},"/v1/course-sync/runs/{runId}:rollback":{"post":{"operationId":"rollbackSyncRun","security":[{"OperatorBearer":[]}],"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string","minLength":1}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Redacted sync run receipt","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRun"}}}}}}}},"components":{"securitySchemes":{"ReadBearer":{"type":"http","scheme":"bearer"},"StageBearer":{"type":"http","scheme":"bearer"},"WorkerBearer":{"type":"http","scheme":"bearer"},"OperatorBearer":{"type":"http","scheme":"bearer"}},"schemas":{"CourseJsonV3":{"type":"object","additionalProperties":false,"required":["$schema","schemaVersion","courseId","courseVersionId","archiveTTL","courseName","sections"],"properties":{"$schema":{"type":"string"},"schemaVersion":{"const":3},"courseId":{"type":"string"},"courseVersionId":{"type":"string"},"archiveTTL":{"const":"90d"},"courseName":{"type":"string"},"sections":{"type":"array","minItems":1,"items":{"type":"object"}}}},"SyncBinding":{"type":"object","required":["bindingId","status","sourceCourseId","target"],"properties":{"bindingId":{"type":"string","minLength":1},"status":{"type":"string","enum":["active","suspended","revoked"]},"sourceCourseId":{"type":"string","minLength":1},"target":{"type":"object","required":["productType","anchorResourceType","requiredState","requiredVisibility","sectionMappingPolicy"],"properties":{"productType":{"const":"self-paced"},"anchorResourceType":{"const":"workshop"},"requiredState":{"const":"draft"},"requiredVisibility":{"const":"unlisted"},"sectionMappingPolicy":{"const":"sections-in-anchor-workshop"}}}}},"SyncRun":{"type":"object","required":["runId","bindingId","courseVersionId","state","noOp","plan"],"properties":{"runId":{"type":"string"},"bindingId":{"type":"string"},"courseVersionId":{"type":"string"},"state":{"type":"string","enum":["staged","previewed","applying","applied","failed","rolled_back"]},"planSha256":{"type":["string","null"]},"noOp":{"type":"boolean"},"failureCode":{"type":["string","null"]},"plan":{"oneOf":[{"type":"null"},{"type":"object","properties":{"resources":{"type":"array","items":{"type":"object"}},"media":{"type":"array","items":{"type":"object"}}}}]},"resourceCounts":{"type":"object"}}}}}}