{"openapi":"3.1.0","info":{"title":"Eduweb API","version":"0.0.0","description":"Public API v1. Every response includes X-Correlation-ID (UUID v4). Clients may send an opaque UUID v4; invalid IDs are replaced. HTTP errors use application/problem+json with type, title, status, detail, and correlationId matching the response header and request log. Unknown routes return 404. Health reports liveness, not dependency readiness."},"components":{"securitySchemes":{"ClerkBearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Clerk session token supplied in the Authorization header."},"AgentBearer":{"type":"http","scheme":"bearer","bearerFormat":"edu_agent_...","description":"Read-only user agent token; issue/rotate with a Clerk session."}},"schemas":{"Health":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"service":{"type":"string","enum":["eduweb-api"]},"version":{"type":"string"},"runtime":{"type":"object","properties":{"name":{"type":"string","enum":["node"]},"version":{"type":"string"}},"required":["name","version"]}},"required":["status","service","version"]},"Problem":{"type":"object","properties":{"type":{"type":"string","enum":["about:blank"]},"title":{"type":"string"},"status":{"type":"integer","minimum":400,"maximum":599},"detail":{"type":"string"},"correlationId":{"type":"string","format":"uuid"}},"required":["type","title","status","detail","correlationId"]},"Listing":{"type":"object","properties":{"schema_version":{"type":"string","enum":["1"]},"upcoming":{"type":"array","items":{"$ref":"#/components/schemas/PublicLiveEvent"}},"past":{"type":"array","items":{"$ref":"#/components/schemas/PublicLiveEvent"}},"lessons":{"type":"array","items":{"$ref":"#/components/schemas/PublicLesson"}}},"required":["schema_version","upcoming","past","lessons"]},"PublicLiveEvent":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"title":{"type":"string","minLength":1,"maxLength":200},"description_md":{"type":"string","maxLength":20000},"hosts":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":20},"starts_at":{"type":"string","format":"date-time"},"tz":{"type":"string","maxLength":100},"duration_min":{"type":"integer","minimum":1,"maximum":1440},"deliverable_md":{"type":"string","maxLength":20000},"skill_tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"maxItems":50},"status":{"type":"string","enum":["published","ended"]},"lesson_id":{"type":"string","nullable":true},"id":{"type":"string","format":"uuid"},"url":{"type":"string"},"machine_url":{"type":"string"}},"required":["slug","title","description_md","hosts","starts_at","tz","duration_min","deliverable_md","skill_tags","status","lesson_id","id","url","machine_url"],"additionalProperties":false},"PublicLesson":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"title":{"type":"string"},"excerpt":{"type":"string"},"source_event_id":{"type":"string","nullable":true},"published_at":{"type":"string","nullable":true,"format":"date-time"},"version":{"type":"integer"},"skill_tags":{"type":"array","items":{"type":"string"}},"hosts":{"type":"array","items":{"type":"string"}},"live_date":{"type":"string","nullable":true,"format":"date-time"},"reading_time_min":{"type":"number"},"url":{"type":"string"},"machine_url":{"type":"string"}},"required":["id","slug","title","excerpt","source_event_id","published_at","version","skill_tags","url","machine_url"]},"LiveEventRepresentation":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/PublicLiveEvent"},"for_humans":{"type":"object","properties":{"description_md":{"type":"string"},"deliverable_md":{"type":"string"}},"required":["description_md","deliverable_md"]},"for_agents":{"type":"object","properties":{"artifacts":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"url":{"type":"string"},"description":{"type":"string"}},"required":["type","url","description"]},"maxItems":0},"note":{"type":"string"}},"required":["artifacts","note"]}},"required":["meta","for_humans","for_agents"]},"Actor":{"type":"object","properties":{"userId":{"type":"string"},"role":{"type":"string","enum":["user","admin"]}},"required":["userId","role"]},"LiveEvent":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"title":{"type":"string","minLength":1,"maxLength":200},"description_md":{"type":"string","maxLength":20000},"hosts":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":20},"starts_at":{"type":"string","format":"date-time"},"tz":{"type":"string","maxLength":100},"duration_min":{"type":"integer","minimum":1,"maximum":1440},"stream_url":{"type":"string","format":"uri"},"deliverable_md":{"type":"string","maxLength":20000},"skill_tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"maxItems":50},"status":{"type":"string","enum":["draft","published","ended"]},"lesson_id":{"type":"string","nullable":true},"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean"}},"required":["slug","title","description_md","hosts","starts_at","tz","duration_min","stream_url","deliverable_md","skill_tags","status","lesson_id","id","deleted"],"additionalProperties":false},"DomainEvent":{"type":"object","properties":{"type":{"type":"string","maxLength":100,"pattern":"^[a-z][a-z_]*\\.[a-z][a-z_]*$"},"subject_user_id":{"type":"string","nullable":true,"maxLength":200},"object_type":{"type":"string","minLength":1,"maxLength":100},"object_id":{"type":"string","minLength":1,"maxLength":200},"payload":{"type":["null","boolean","number","string","array","object"],"description":"Arbitrary JSON context; never include secrets."},"id":{"type":"string","format":"uuid"},"idempotency_key":{"type":"string"},"ts":{"type":"string","format":"date-time"},"actor_type":{"type":"string","enum":["user","agent","system"]},"actor_id":{"type":"string"},"source":{"type":"string","enum":["web","agent","api","mail","system"]}},"required":["type","subject_user_id","object_type","object_id","payload","id","idempotency_key","ts","actor_type","actor_id","source"],"additionalProperties":false},"LessonRepresentation":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/PublicLesson"},"for_humans":{"type":"object","properties":{"excerpt":{"type":"string"},"content_md":{"type":"string"}},"required":["excerpt"]},"for_agents":{"type":"object","properties":{"artifacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$"},"type":{"type":"string","enum":["skill","file","checklist"]},"description":{"type":"string","minLength":1,"maxLength":2000},"mime":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9.+-]+\\/[a-zA-Z0-9.+-]+$"},"size":{"type":"integer","minimum":0,"maximum":20000000},"url":{"type":"string"}},"required":["name","type","description","mime","size","url"]}},"note":{"type":"string"}},"required":["artifacts","note"]}},"required":["meta","for_humans","for_agents"]},"Course":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"title":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"skills":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"outcome":{"type":"string","minLength":1,"maxLength":500}},"required":["slug","outcome"],"additionalProperties":false},"minItems":1,"maxItems":50},"modules":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"lessons":{"type":"array","items":{"type":"object","properties":{"lesson_id":{"type":"string","format":"uuid"},"checkpoint":{"type":"string","nullable":true,"minLength":1,"maxLength":2000},"lesson":{"$ref":"#/components/schemas/PublicLesson"}},"required":["lesson_id","checkpoint","lesson"],"additionalProperties":false}}},"required":["title","lessons"],"additionalProperties":false}},"url":{"type":"string"}},"required":["id","slug","title","summary","skills","modules","url"],"additionalProperties":false},"AuthoringSession":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"revision":{"type":"integer","minimum":1},"state":{"type":"string","enum":["recorded","planned","approved","drafted","published"]},"recording":{"type":"object","properties":{"event_id":{"type":"string"},"source_url":{"type":"string"},"transcript":{"type":"string"},"status":{"type":"string","enum":["ready","stub"]}},"required":["event_id","source_url","transcript","status"]},"lesson":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"title":{"type":"string","minLength":1,"maxLength":200},"excerpt":{"type":"string","maxLength":2000},"source_event_id":{"type":"string","nullable":true},"repo_path":{"type":"string","maxLength":300,"pattern":"^[A-Za-z0-9_-]+(?:\\/[A-Za-z0-9_-]+)*$"},"version":{"type":"integer","minimum":1},"skill_tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"maxItems":50},"hosts":{"type":"array","items":{"type":"string"}},"live_date":{"type":"string","nullable":true},"reading_time_min":{"type":"number"},"artifacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$"},"type":{"type":"string","enum":["skill","file","checklist"]},"description":{"type":"string","minLength":1,"maxLength":2000},"mime":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9.+-]+\\/[a-zA-Z0-9.+-]+$"},"size":{"type":"integer","minimum":0,"maximum":20000000}},"required":["name","type","description","mime","size"]}},"status":{"type":"string","enum":["draft","published"]},"published_at":{"type":"string","nullable":true}},"required":["id","slug","title","excerpt","source_event_id","repo_path","version","skill_tags","status","published_at"],"additionalProperties":false},"plan":{"type":"object","nullable":true,"properties":{"goal":{"type":"string","minLength":1,"maxLength":2000},"sections":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"minItems":1,"maxItems":30},"clips":{"type":"array","items":{"type":"string","maxLength":2000},"maxItems":30},"screenshots":{"type":"array","items":{"type":"string","maxLength":2000},"maxItems":30},"artifacts":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"minItems":1,"maxItems":30}},"required":["goal","sections","clips","screenshots","artifacts"],"additionalProperties":false},"draft":{"type":"object","nullable":true,"properties":{"for_humans":{"type":"string","minLength":1,"maxLength":80000},"skill":{"type":"string","minLength":1,"maxLength":40000}},"required":["for_humans","skill"],"additionalProperties":false},"review":{"type":"object","properties":{"status":{"type":"string","enum":["held","changes_requested"]},"note":{"type":"string","maxLength":2000}},"required":["status","note"]}},"required":["id","revision","state","recording","lesson","plan","draft"]}},"parameters":{}},"paths":{"/v1/health":{"get":{"operationId":"getHealth","security":[],"summary":"Report API liveness and public service metadata","description":"Liveness only; does not check persistence or external services.","parameters":[{"schema":{"type":"string","enum":["basic","runtime"],"default":"basic","description":"Include Node.js runtime metadata when set to runtime."},"required":false,"description":"Include Node.js runtime metadata when set to runtime.","name":"detail","in":"query"},{"schema":{"type":"string","description":"Optional opaque UUID v4. Invalid values are replaced, not echoed. Never send personal data or credentials as an ID."},"required":false,"description":"Optional opaque UUID v4. Invalid values are replaced, not echoed. Never send personal data or credentials as an ID.","name":"x-correlation-id","in":"header"}],"responses":{"200":{"description":"The API can serve requests.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"400":{"description":"Invalid query parameters.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"An unexpected server error occurred.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/live-events/{slug}/registration":{"get":{"operationId":"getLiveRegistration","summary":"read own registration; join URL only during T−1h through scheduled end. Double submits are state-idempotent.","security":[{"ClerkBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Current state.","content":{"application/json":{"schema":{"type":"object","properties":{"registered":{"type":"boolean"},"joined_at":{"type":"string","nullable":true},"join_opens_at":{"type":"string"},"stream_url":{"type":"string","nullable":true}},"required":["registered","joined_at","join_opens_at","stream_url"]}}}},"400":{"description":"Invalid input.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Event not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Registration or join is not available.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/live-events/{slug}/registrations":{"post":{"operationId":"registerForLiveEvent","summary":"register own registration; join URL only during T−1h through scheduled end. Double submits are state-idempotent.","security":[{"ClerkBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Current state.","content":{"application/json":{"schema":{"type":"object","properties":{"registered":{"type":"boolean"},"joined_at":{"type":"string","nullable":true},"join_opens_at":{"type":"string"},"stream_url":{"type":"string","nullable":true}},"required":["registered","joined_at","join_opens_at","stream_url"]}}}},"400":{"description":"Invalid input.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Event not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Registration or join is not available.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"operationId":"unregisterFromLiveEvent","summary":"unregister own registration; join URL only during T−1h through scheduled end. Double submits are state-idempotent.","security":[{"ClerkBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Current state.","content":{"application/json":{"schema":{"type":"object","properties":{"registered":{"type":"boolean"},"joined_at":{"type":"string","nullable":true},"join_opens_at":{"type":"string"},"stream_url":{"type":"string","nullable":true}},"required":["registered","joined_at","join_opens_at","stream_url"]}}}},"400":{"description":"Invalid input.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Event not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Registration or join is not available.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/live-events/{slug}/join":{"post":{"operationId":"joinLiveEvent","summary":"join own registration; join URL only during T−1h through scheduled end. Double submits are state-idempotent.","security":[{"ClerkBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Current state.","content":{"application/json":{"schema":{"type":"object","properties":{"registered":{"type":"boolean"},"joined_at":{"type":"string","nullable":true},"join_opens_at":{"type":"string"},"stream_url":{"type":"string","nullable":true}},"required":["registered","joined_at","join_opens_at","stream_url"]}}}},"400":{"description":"Invalid input.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Event not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Registration or join is not available.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/account":{"post":{"operationId":"provisionAccount","summary":"Idempotently provision first-login account, empty profile and default-off consents. No email is inferred from login.","security":[{"ClerkBearer":[]}],"responses":{"200":{"description":"Current state.","content":{"application/json":{"schema":{"type":"object","properties":{"user_id":{"type":"string"},"consents":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["email","push","profile_inference"]},"granted":{"type":"boolean"},"user_id":{"type":"string"},"ts":{"type":"string"}},"required":["type","granted","user_id","ts"]}}},"required":["user_id","consents"]}}}},"400":{"description":"Invalid input.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Event not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Registration or join is not available.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/account/consents":{"put":{"operationId":"setConsent","summary":"Set own explicit consent; repeat values do not append duplicate events. Push transport is not yet available.","security":[{"ClerkBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["email","push","profile_inference"]},"granted":{"type":"boolean"}},"required":["type","granted"]}}}},"responses":{"200":{"description":"Current state.","content":{"application/json":{"schema":{"type":"object","properties":{"user_id":{"type":"string"},"consents":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["email","push","profile_inference"]},"granted":{"type":"boolean"},"user_id":{"type":"string"},"ts":{"type":"string"}},"required":["type","granted","user_id","ts"]}}},"required":["user_id","consents"]}}}},"400":{"description":"Invalid input.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Event not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Registration or join is not available.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/live-events/{slug}/calendar":{"get":{"operationId":"getLiveCalendar","summary":"Registered user's calendar file; no private stream URL.","security":[{"ClerkBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"RFC 5545 calendar.","content":{"text/calendar":{"schema":{"type":"string"}}}},"400":{"description":"Invalid input.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Event not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Registration or join is not available.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/agents/live-reminder":{"put":{"operationId":"configureLiveReminder","summary":"Enable/disable reminder delivery and configure rolling seven-day budget (default four).","security":[{"ClerkBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"weeklyBudget":{"type":"integer","minimum":0,"maximum":100}},"required":["enabled","weeklyBudget"]}}}},"responses":{"200":{"description":"Current state.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"weeklyBudget":{"type":"integer","minimum":0,"maximum":100}},"required":["enabled","weeklyBudget"]}}}},"400":{"description":"Invalid input.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Event not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Registration or join is not available.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/me/profile":{"get":{"operationId":"getOwnProfile","summary":"Read own profile, system inferences, consents, touched skills and recent activity. Provision default-off account on first access.","security":[{"ClerkBearer":[]}],"responses":{"200":{"description":"Current own profile; newest 100 activity entries, no private event payloads or token digest.","content":{"application/json":{"schema":{"type":"object","properties":{"identity":{"type":"object","properties":{"id":{"type":"string"},"google_id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"avatar":{"type":"string","nullable":true}},"required":["id","google_id","email","name","avatar"]},"master_prompt":{"type":"string"},"memories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"user_id":{"type":"string"},"text":{"type":"string"},"source":{"type":"string","enum":["user","system"]},"skill_tags":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"deleted_at":{"type":"string","nullable":true}},"required":["id","user_id","text","source","skill_tags","created_at","deleted_at"]}},"learning_profile":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"skill_tags":{"type":"array","items":{"type":"string"}},"source":{"type":"string","enum":["system"]}},"required":["id","text","skill_tags","source"]}},"consents":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"string"},"type":{"type":"string","enum":["email","push","profile_inference"]},"granted":{"type":"boolean"},"ts":{"type":"string"}},"required":["user_id","type","granted","ts"]}},"touched_skills":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["slug","name","description"]}},"activity":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ts":{"type":"string"},"type":{"type":"string"},"object_type":{"type":"string"},"object_id":{"type":"string"}},"required":["id","ts","type","object_type","object_id"]}}},"required":["identity","master_prompt","memories","learning_profile","consents","touched_skills","activity"]}}}},"400":{"description":"Invalid input.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Clerk session required; agent tokens cannot manage profiles.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Memory not found in own profile.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Invalid change.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"patch":{"operationId":"updateMasterPrompt","summary":"Edit own master prompt; private text is not copied into the event stream.","security":[{"ClerkBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"master_prompt":{"type":"string","maxLength":10000}},"required":["master_prompt"],"additionalProperties":false}}}},"responses":{"200":{"description":"Current own profile; newest 100 activity entries, no private event payloads or token digest.","content":{"application/json":{"schema":{"type":"object","properties":{"identity":{"type":"object","properties":{"id":{"type":"string"},"google_id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"avatar":{"type":"string","nullable":true}},"required":["id","google_id","email","name","avatar"]},"master_prompt":{"type":"string"},"memories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"user_id":{"type":"string"},"text":{"type":"string"},"source":{"type":"string","enum":["user","system"]},"skill_tags":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"deleted_at":{"type":"string","nullable":true}},"required":["id","user_id","text","source","skill_tags","created_at","deleted_at"]}},"learning_profile":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"skill_tags":{"type":"array","items":{"type":"string"}},"source":{"type":"string","enum":["system"]}},"required":["id","text","skill_tags","source"]}},"consents":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"string"},"type":{"type":"string","enum":["email","push","profile_inference"]},"granted":{"type":"boolean"},"ts":{"type":"string"}},"required":["user_id","type","granted","ts"]}},"touched_skills":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["slug","name","description"]}},"activity":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ts":{"type":"string"},"type":{"type":"string"},"object_type":{"type":"string"},"object_id":{"type":"string"}},"required":["id","ts","type","object_type","object_id"]}}},"required":["identity","master_prompt","memories","learning_profile","consents","touched_skills","activity"]}}}},"400":{"description":"Invalid input.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Clerk session required; agent tokens cannot manage profiles.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Memory not found in own profile.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Invalid change.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/me/memories":{"post":{"operationId":"createMemory","summary":"Create a user-sourced memory in own profile.","security":[{"ClerkBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["text"],"additionalProperties":false}}}},"responses":{"200":{"description":"Current own profile; newest 100 activity entries, no private event payloads or token digest.","content":{"application/json":{"schema":{"type":"object","properties":{"identity":{"type":"object","properties":{"id":{"type":"string"},"google_id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"avatar":{"type":"string","nullable":true}},"required":["id","google_id","email","name","avatar"]},"master_prompt":{"type":"string"},"memories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"user_id":{"type":"string"},"text":{"type":"string"},"source":{"type":"string","enum":["user","system"]},"skill_tags":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"deleted_at":{"type":"string","nullable":true}},"required":["id","user_id","text","source","skill_tags","created_at","deleted_at"]}},"learning_profile":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"skill_tags":{"type":"array","items":{"type":"string"}},"source":{"type":"string","enum":["system"]}},"required":["id","text","skill_tags","source"]}},"consents":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"string"},"type":{"type":"string","enum":["email","push","profile_inference"]},"granted":{"type":"boolean"},"ts":{"type":"string"}},"required":["user_id","type","granted","ts"]}},"touched_skills":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["slug","name","description"]}},"activity":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ts":{"type":"string"},"type":{"type":"string"},"object_type":{"type":"string"},"object_id":{"type":"string"}},"required":["id","ts","type","object_type","object_id"]}}},"required":["identity","master_prompt","memories","learning_profile","consents","touched_skills","activity"]}}}},"400":{"description":"Invalid input.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Clerk session required; agent tokens cannot manage profiles.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Memory not found in own profile.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Invalid change.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/me/memories/{id}":{"patch":{"operationId":"editMemory","summary":"Edit own memory, preserving original user/system provenance.","security":[{"ClerkBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["text"],"additionalProperties":false}}}},"responses":{"200":{"description":"Current own profile; newest 100 activity entries, no private event payloads or token digest.","content":{"application/json":{"schema":{"type":"object","properties":{"identity":{"type":"object","properties":{"id":{"type":"string"},"google_id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"avatar":{"type":"string","nullable":true}},"required":["id","google_id","email","name","avatar"]},"master_prompt":{"type":"string"},"memories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"user_id":{"type":"string"},"text":{"type":"string"},"source":{"type":"string","enum":["user","system"]},"skill_tags":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"deleted_at":{"type":"string","nullable":true}},"required":["id","user_id","text","source","skill_tags","created_at","deleted_at"]}},"learning_profile":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"skill_tags":{"type":"array","items":{"type":"string"}},"source":{"type":"string","enum":["system"]}},"required":["id","text","skill_tags","source"]}},"consents":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"string"},"type":{"type":"string","enum":["email","push","profile_inference"]},"granted":{"type":"boolean"},"ts":{"type":"string"}},"required":["user_id","type","granted","ts"]}},"touched_skills":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["slug","name","description"]}},"activity":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ts":{"type":"string"},"type":{"type":"string"},"object_type":{"type":"string"},"object_id":{"type":"string"}},"required":["id","ts","type","object_type","object_id"]}}},"required":["identity","master_prompt","memories","learning_profile","consents","touched_skills","activity"]}}}},"400":{"description":"Invalid input.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Clerk session required; agent tokens cannot manage profiles.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Memory not found in own profile.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Invalid change.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"operationId":"deleteMemory","summary":"Soft-delete own memory and derived inference, erasing text. Repeated deletion is safe; replay cannot resurrect it.","security":[{"ClerkBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Current own profile; newest 100 activity entries, no private event payloads or token digest.","content":{"application/json":{"schema":{"type":"object","properties":{"identity":{"type":"object","properties":{"id":{"type":"string"},"google_id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"avatar":{"type":"string","nullable":true}},"required":["id","google_id","email","name","avatar"]},"master_prompt":{"type":"string"},"memories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"user_id":{"type":"string"},"text":{"type":"string"},"source":{"type":"string","enum":["user","system"]},"skill_tags":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"deleted_at":{"type":"string","nullable":true}},"required":["id","user_id","text","source","skill_tags","created_at","deleted_at"]}},"learning_profile":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"skill_tags":{"type":"array","items":{"type":"string"}},"source":{"type":"string","enum":["system"]}},"required":["id","text","skill_tags","source"]}},"consents":{"type":"array","items":{"type":"object","properties":{"user_id":{"type":"string"},"type":{"type":"string","enum":["email","push","profile_inference"]},"granted":{"type":"boolean"},"ts":{"type":"string"}},"required":["user_id","type","granted","ts"]}},"touched_skills":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["slug","name","description"]}},"activity":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ts":{"type":"string"},"type":{"type":"string"},"object_type":{"type":"string"},"object_id":{"type":"string"}},"required":["id","ts","type","object_type","object_id"]}}},"required":["identity","master_prompt","memories","learning_profile","consents","touched_skills","activity"]}}}},"400":{"description":"Invalid input.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Clerk session required; agent tokens cannot manage profiles.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Memory not found in own profile.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Invalid change.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/agents/profiler":{"put":{"operationId":"configureProfiler","summary":"Enable/disable consent-gated deterministic stub Profiler for future activity. No replay on re-enable.","security":[{"ClerkBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"Current own profile; newest 100 activity entries, no private event payloads or token digest.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"400":{"description":"Invalid input.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Clerk session required; agent tokens cannot manage profiles.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Memory not found in own profile.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Invalid change.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/listing":{"get":{"operationId":"getListing","summary":"Public upcoming/past live events and published lesson metadata; relative URLs resolve against the web origin","security":[],"responses":{"200":{"description":"Public catalog; no stream URLs or full lesson content.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Listing"}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resource not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"ID, slug or idempotency scope conflicts.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence or identity unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/live-events/{slug}":{"get":{"operationId":"getLiveEvent","summary":"Public live event machine representation","security":[],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Public event only; drafts and deleted events are 404.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiveEventRepresentation"}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resource not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"ID, slug or idempotency scope conflicts.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence or identity unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/me":{"get":{"operationId":"getActor","summary":"Verified Clerk actor; not account provisioning","security":[{"ClerkBearer":[]}],"responses":{"200":{"description":"Signed-in actor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Actor"}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resource not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"ID, slug or idempotency scope conflicts.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence or identity unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/live-events":{"get":{"operationId":"listAdminLiveEvents","summary":"Admin catalog including drafts and private stream URLs","security":[{"ClerkBearer":[]}],"responses":{"200":{"description":"Admin events including tombstones.","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/LiveEvent"}}},"required":["events"]}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resource not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"ID, slug or idempotency scope conflicts.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence or identity unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"operationId":"createLiveEvent","summary":"Create a live event and audit atomically; supply a stable UUID and idempotency key","security":[{"ClerkBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$","description":"Reuse for retries of the same operation. The first result wins; scope is actor and capability."},"required":true,"description":"Reuse for retries of the same operation. The first result wins; scope is actor and capability.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"title":{"type":"string","minLength":1,"maxLength":200},"description_md":{"type":"string","maxLength":20000},"hosts":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":20},"starts_at":{"type":"string","format":"date-time"},"tz":{"type":"string","maxLength":100},"duration_min":{"type":"integer","minimum":1,"maximum":1440},"stream_url":{"type":"string","format":"uri"},"deliverable_md":{"type":"string","maxLength":20000},"skill_tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"maxItems":50},"status":{"type":"string","enum":["draft","published","ended"]},"lesson_id":{"type":"string","nullable":true},"id":{"type":"string","format":"uuid"}},"required":["slug","title","description_md","hosts","starts_at","tz","duration_min","stream_url","deliverable_md","skill_tags","status","lesson_id","id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Created event or original retry result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiveEvent"}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resource not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"ID, slug or idempotency scope conflicts.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence or identity unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/live-events/{id}":{"put":{"operationId":"replaceLiveEvent","summary":"Replace all live event fields and append audit atomically","security":[{"ClerkBearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$","description":"Reuse for retries of the same operation. The first result wins; scope is actor and capability."},"required":true,"description":"Reuse for retries of the same operation. The first result wins; scope is actor and capability.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"title":{"type":"string","minLength":1,"maxLength":200},"description_md":{"type":"string","maxLength":20000},"hosts":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":20},"starts_at":{"type":"string","format":"date-time"},"tz":{"type":"string","maxLength":100},"duration_min":{"type":"integer","minimum":1,"maximum":1440},"stream_url":{"type":"string","format":"uri"},"deliverable_md":{"type":"string","maxLength":20000},"skill_tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"maxItems":50},"status":{"type":"string","enum":["draft","published","ended"]},"lesson_id":{"type":"string","nullable":true}},"required":["slug","title","description_md","hosts","starts_at","tz","duration_min","stream_url","deliverable_md","skill_tags","status","lesson_id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated event or original retry result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiveEvent"}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resource not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"ID, slug or idempotency scope conflicts.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence or identity unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"operationId":"deleteLiveEvent","summary":"Tombstone a live event; preserve audit history","security":[{"ClerkBearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$","description":"Reuse for retries of the same operation. The first result wins; scope is actor and capability."},"required":true,"description":"Reuse for retries of the same operation. The first result wins; scope is actor and capability.","name":"idempotency-key","in":"header"}],"responses":{"200":{"description":"Tombstoned event or original retry result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiveEvent"}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resource not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"ID, slug or idempotency scope conflicts.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence or identity unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/event-log":{"post":{"operationId":"appendDomainEvent","summary":"Append an event as the verified admin; actor, time, source and key namespace are server-owned","security":[{"ClerkBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$","description":"Reuse for retries of the same operation. The first result wins; scope is actor and capability."},"required":true,"description":"Reuse for retries of the same operation. The first result wins; scope is actor and capability.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","maxLength":100,"pattern":"^[a-z][a-z_]*\\.[a-z][a-z_]*$"},"subject_user_id":{"type":"string","nullable":true,"maxLength":200},"object_type":{"type":"string","minLength":1,"maxLength":100},"object_id":{"type":"string","minLength":1,"maxLength":200},"payload":{"type":["null","boolean","number","string","array","object"],"description":"Arbitrary JSON context; never include secrets."}},"required":["type","subject_user_id","object_type","object_id","payload"],"additionalProperties":false}}}},"responses":{"200":{"description":"Original event for the idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainEvent"}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Resource not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"ID, slug or idempotency scope conflicts.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence or identity unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"get":{"operationId":"getAdminTimeline","summary":"Newest first (timestamp then ID descending); exact filters intersect; user matches subject or human actor; agent matches agent actor. Filters apply before limit.","security":[{"ClerkBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":false,"name":"user","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":100},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200},"required":false,"name":"agent","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Admin-only response; lists are previews of at most 100 rows.","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/DomainEvent"}}},"required":["events"]}}}},"400":{"description":"Invalid filters.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Sign in required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"User not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Admin persistence or Clerk unavailable; retry grant if it partially completed.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Request failed.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/users":{"get":{"operationId":"getAdminUsers","summary":"Latest 100 provisioned accounts; role is a local mirror, Clerk session claims authorize access","security":[{"ClerkBearer":[]}],"responses":{"200":{"description":"Admin-only response; lists are previews of at most 100 rows.","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"google_id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"avatar":{"type":"string","nullable":true},"role":{"type":"string","enum":["user","admin"]},"created_at":{"type":"string"}},"required":["id","google_id","email","name","avatar","role","created_at"]}}},"required":["users"]}}}},"400":{"description":"Invalid filters.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Sign in required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"User not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Admin persistence or Clerk unavailable; retry grant if it partially completed.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Request failed.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/users/{id}/role":{"put":{"operationId":"grantAdminRole","summary":"Grant admin in Clerk then persist an audit; idempotent grant-only operation, new session token required","security":[{"ClerkBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["admin"]}},"required":["role"],"additionalProperties":false}}}},"responses":{"200":{"description":"Admin-only response; lists are previews of at most 100 rows.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"google_id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"avatar":{"type":"string","nullable":true},"role":{"type":"string","enum":["user","admin"]},"created_at":{"type":"string"}},"required":["id","google_id","email","name","avatar","role","created_at"]}}}},"400":{"description":"Invalid filters.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Sign in required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"User not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Admin persistence or Clerk unavailable; retry grant if it partially completed.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Request failed.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/lessons":{"get":{"operationId":"getAdminLessons","summary":"Lesson states, including drafts; first 100 by ID","security":[{"ClerkBearer":[]}],"responses":{"200":{"description":"Admin-only response; lists are previews of at most 100 rows.","content":{"application/json":{"schema":{"type":"object","properties":{"lessons":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["draft","published"]},"version":{"type":"number"},"published_at":{"type":"string","nullable":true}},"required":["id","slug","title","status","version","published_at"]}}},"required":["lessons"]}}}},"400":{"description":"Invalid filters.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Sign in required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"User not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Admin persistence or Clerk unavailable; retry grant if it partially completed.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Request failed.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/agents":{"get":{"operationId":"getAdminAgents","summary":"Agent settings, latest completed runs, next pending notifications and recorded failure events; not a unified runtime queue","security":[{"ClerkBearer":[]}],"responses":{"200":{"description":"Admin-only response; lists are previews of at most 100 rows.","content":{"application/json":{"schema":{"type":"object","properties":{"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"weeklyBudget":{"type":"number"}},"required":["id","enabled","weeklyBudget"]}},"runs":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string"},"trigger_id":{"type":"string"},"started_at":{"type":"string"},"finished_at":{"type":"string"},"status":{"type":"string","enum":["finished"]}},"required":["agent_id","trigger_id","started_at","finished_at","status"]}},"queue":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"scheduled_at":{"type":"string"},"status":{"type":"string"}},"required":["id","type","scheduled_at","status"]}},"errors":{"type":"array","items":{"$ref":"#/components/schemas/DomainEvent"}}},"required":["agents","runs","queue","errors"]}}}},"400":{"description":"Invalid filters.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Sign in required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"User not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Admin persistence or Clerk unavailable; retry grant if it partially completed.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Request failed.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/lessons/{slug}":{"get":{"operationId":"getLessonMetadata","summary":"Published lesson: public excerpt/artifact descriptors; full markdown with Clerk or agent bearer","security":[{},{"ClerkBearer":[]},{"AgentBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Explicit meta, for_humans, for_agents sections. Artifact URLs resolve against the web origin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LessonRepresentation"}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Published lesson or artifact not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Version, file size or idempotency conflict.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Machine request limit reached.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Identity, content or persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/lessons/{slug}/artifacts/{name}":{"get":{"operationId":"downloadLessonArtifact","summary":"Download an artifact; agent tokens log lesson.agent_fetched, Clerk sessions log lesson.artifact_downloaded","security":[{"ClerkBearer":[]},{"AgentBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$"},"required":true,"name":"name","in":"path"}],"responses":{"200":{"description":"Attachment bytes with descriptor MIME and Content-Disposition; never cached.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Published lesson or artifact not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Version, file size or idempotency conflict.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Machine request limit reached.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Identity, content or persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/me/agent-token":{"post":{"operationId":"rotateAgentToken","summary":"Issue/rotate a read-only lesson token; plaintext returned once, previous token immediately invalid","security":[{"ClerkBearer":[]}],"responses":{"200":{"description":"Store securely; not recoverable later.","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"scope":{"type":"string","enum":["lessons:read"]}},"required":["token","scope"]}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Published lesson or artifact not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Version, file size or idempotency conflict.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Machine request limit reached.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Identity, content or persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"operationId":"revokeAgentToken","summary":"Revoke the current user's agent token","security":[{"ClerkBearer":[]}],"responses":{"200":{"description":"Token revoked.","content":{"application/json":{"schema":{"type":"object","properties":{"revoked":{"type":"boolean","enum":[true]}},"required":["revoked"]}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Published lesson or artifact not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Version, file size or idempotency conflict.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Machine request limit reached.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Identity, content or persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/lessons/publish":{"post":{"operationId":"publishLesson","summary":"Publish deployed files and artifact descriptors atomically with lesson.published; strictly increasing version","security":[{"ClerkBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$","description":"Reuse for retries of the same operation. The first result wins; scope is actor and capability."},"required":true,"description":"Reuse for retries of the same operation. The first result wins; scope is actor and capability.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"title":{"type":"string","minLength":1,"maxLength":200},"excerpt":{"type":"string","maxLength":2000},"source_event_id":{"type":"string","nullable":true},"repo_path":{"type":"string","maxLength":300,"pattern":"^[A-Za-z0-9_-]+(?:\\/[A-Za-z0-9_-]+)*$"},"version":{"type":"integer","minimum":1},"skill_tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"maxItems":50},"hosts":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20},"live_date":{"type":"string","nullable":true,"format":"date-time"},"reading_time_min":{"type":"integer","minimum":1,"maximum":1440},"artifacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$"},"type":{"type":"string","enum":["skill","file","checklist"]},"description":{"type":"string","minLength":1,"maxLength":2000},"mime":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9.+-]+\\/[a-zA-Z0-9.+-]+$"},"size":{"type":"integer","minimum":0,"maximum":20000000}},"required":["name","type","description","mime","size"]},"minItems":1,"maxItems":100}},"required":["id","slug","title","excerpt","source_event_id","repo_path","version","skill_tags","hosts","live_date","reading_time_min","artifacts"],"additionalProperties":false}}}},"responses":{"200":{"description":"Published lesson or original retry result.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"title":{"type":"string","minLength":1,"maxLength":200},"excerpt":{"type":"string","maxLength":2000},"source_event_id":{"type":"string","nullable":true},"repo_path":{"type":"string","maxLength":300,"pattern":"^[A-Za-z0-9_-]+(?:\\/[A-Za-z0-9_-]+)*$"},"version":{"type":"integer","minimum":1},"skill_tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"maxItems":50},"hosts":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20},"live_date":{"type":"string","nullable":true,"format":"date-time"},"reading_time_min":{"type":"integer","minimum":1,"maximum":1440},"artifacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$"},"type":{"type":"string","enum":["skill","file","checklist"]},"description":{"type":"string","minLength":1,"maxLength":2000},"mime":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9.+-]+\\/[a-zA-Z0-9.+-]+$"},"size":{"type":"integer","minimum":0,"maximum":20000000}},"required":["name","type","description","mime","size"]},"minItems":1,"maxItems":100},"status":{"type":"string","enum":["published"]},"published_at":{"type":"string"}},"required":["id","slug","title","excerpt","source_event_id","repo_path","version","skill_tags","hosts","live_date","reading_time_min","artifacts","status","published_at"],"additionalProperties":false}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Authentication required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Published lesson or artifact not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Version, file size or idempotency conflict.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Machine request limit reached.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Identity, content or persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/courses":{"get":{"operationId":"listCourses","summary":"Public courses with ordered modules, lesson metadata and outcome skills; incomplete paths are hidden","security":[],"responses":{"200":{"description":"Published course paths. No private lesson bytes.","content":{"application/json":{"schema":{"type":"object","properties":{"courses":{"type":"array","items":{"$ref":"#/components/schemas/Course"}}},"required":["courses"]}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Sign in required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Published course or lesson not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Course identity, path or skills conflict.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/courses/{slug}":{"get":{"operationId":"getCourse","summary":"Read a public course path; checkpoint text is an ungraded practice stub","security":[],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Ordered playlist and skills grid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course"}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Sign in required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Published course or lesson not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Course identity, path or skills conflict.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/courses":{"post":{"operationId":"publishCourse","summary":"Create a course over published lessons; exact retries return the original, edits conflict","security":[{"ClerkBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"title":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"skills":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"outcome":{"type":"string","minLength":1,"maxLength":500}},"required":["slug","outcome"],"additionalProperties":false},"minItems":1,"maxItems":50},"modules":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"lessons":{"type":"array","items":{"type":"object","properties":{"lesson_id":{"type":"string","format":"uuid"},"checkpoint":{"type":"string","nullable":true,"minLength":1,"maxLength":2000}},"required":["lesson_id","checkpoint"],"additionalProperties":false},"minItems":1,"maxItems":50}},"required":["title","lessons"],"additionalProperties":false},"minItems":1,"maxItems":20}},"required":["id","slug","title","summary","skills","modules"],"additionalProperties":false}}}},"responses":{"200":{"description":"Course published atomically with course.published.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"title":{"type":"string","minLength":1,"maxLength":200},"summary":{"type":"string","minLength":1,"maxLength":2000},"skills":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"outcome":{"type":"string","minLength":1,"maxLength":500}},"required":["slug","outcome"],"additionalProperties":false},"minItems":1,"maxItems":50},"modules":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"lessons":{"type":"array","items":{"type":"object","properties":{"lesson_id":{"type":"string","format":"uuid"},"checkpoint":{"type":"string","nullable":true,"minLength":1,"maxLength":2000}},"required":["lesson_id","checkpoint"],"additionalProperties":false},"minItems":1,"maxItems":50}},"required":["title","lessons"],"additionalProperties":false},"minItems":1,"maxItems":20}},"required":["id","slug","title","summary","skills","modules"],"additionalProperties":false}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Sign in required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Published course or lesson not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Course identity, path or skills conflict.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/courses/{slug}/enrollment":{"post":{"operationId":"enrollInCourse","summary":"Enroll the current Clerk user once; retries retain the original date, no completion claim","security":[{"ClerkBearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Enrollment with course.enrolled audit; does not touch skills.","content":{"application/json":{"schema":{"type":"object","properties":{"course_id":{"type":"string"},"user_id":{"type":"string"},"enrolled_at":{"type":"string"}},"required":["course_id","user_id","enrolled_at"]}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Sign in required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Published course or lesson not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Course identity, path or skills conflict.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Persistence unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/authoring":{"get":{"operationId":"listAuthoring","summary":"List the latest 100 private authoring sessions, newest first, with review links","security":[{"ClerkBearer":[]}],"responses":{"200":{"description":"Private authoring snapshot. Draft content never enters the public catalog.","content":{"application/json":{"schema":{"type":"object","properties":{"sessions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"revision":{"type":"integer","minimum":1},"state":{"type":"string","enum":["recorded","planned","approved","drafted","published"]},"review":{"type":"object","properties":{"status":{"type":"string","enum":["held","changes_requested"]},"note":{"type":"string","maxLength":2000}},"required":["status","note"]},"title":{"type":"string"},"review_url":{"type":"string"}},"required":["id","revision","state","title","review_url"]}}},"required":["sessions"]}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Sign in required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin only.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Session or source event not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Stale revision, invalid transition or publication collision.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Author disabled or provider/persistence/files unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"operationId":"recordLesson","summary":"Link a recording and supply a transcript, or get an explicitly marked transcription stub. Client UUID is the resume ID.","security":[{"ClerkBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"event_id":{"type":"string","format":"uuid"},"source_url":{"type":"string","maxLength":4000,"format":"uri"},"transcript":{"type":"string","minLength":1,"maxLength":120000},"slug":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"title":{"type":"string","minLength":1,"maxLength":200},"excerpt":{"type":"string","maxLength":2000},"skill_tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"maxItems":50}},"required":["id","event_id","source_url","slug","title","excerpt","skill_tags"],"additionalProperties":false}}}},"responses":{"200":{"description":"Private authoring snapshot. Draft content never enters the public catalog.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthoringSession"}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Sign in required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin only.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Session or source event not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Stale revision, invalid transition or publication collision.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Author disabled or provider/persistence/files unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/authoring/signals":{"post":{"operationId":"receiveRecordingSignal","summary":"Recording URL → private review draft using the existing Author pipeline; never publishes. On failure inspect the queue before retrying.","security":[{"ClerkBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"recording_url":{"type":"string","maxLength":4000,"format":"uri"},"live_event_id":{"type":"string","format":"uuid"},"title":{"type":"string","minLength":1,"maxLength":200}},"required":["recording_url"],"additionalProperties":false}}}},"responses":{"200":{"description":"Private authoring snapshot. Draft content never enters the public catalog.","content":{"application/json":{"schema":{"type":"object","properties":{"session":{"$ref":"#/components/schemas/AuthoringSession"},"review_url":{"type":"string"}},"required":["session","review_url"]}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Sign in required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin only.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Session or source event not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Stale revision, invalid transition or publication collision.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Author disabled or provider/persistence/files unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/authoring/{id}":{"get":{"operationId":"previewAuthoring","summary":"Resume or preview both private draft representations, plan and transcript status","security":[{"ClerkBearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Private authoring snapshot. Draft content never enters the public catalog.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthoringSession"}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Sign in required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin only.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Session or source event not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Stale revision, invalid transition or publication collision.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Author disabled or provider/persistence/files unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/admin/authoring/{id}/actions":{"post":{"operationId":"advanceAuthoring","summary":"Plan → approve/edit plan → draft → edit → publish. Hold or request_changes stores a private coordinator request and blocks publication until edit or resume_review. Revision guards lost edits; publication retries return the original result.","security":[{"ClerkBearer":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","enum":["plan"]},"revision":{"type":"integer","minimum":1}},"required":["action","revision"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["approve"]},"revision":{"type":"integer","minimum":1},"plan":{"type":"object","properties":{"goal":{"type":"string","minLength":1,"maxLength":2000},"sections":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"minItems":1,"maxItems":30},"clips":{"type":"array","items":{"type":"string","maxLength":2000},"maxItems":30},"screenshots":{"type":"array","items":{"type":"string","maxLength":2000},"maxItems":30},"artifacts":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"minItems":1,"maxItems":30}},"required":["goal","sections","clips","screenshots","artifacts"],"additionalProperties":false}},"required":["action","revision","plan"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["draft"]},"revision":{"type":"integer","minimum":1}},"required":["action","revision"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["edit"]},"revision":{"type":"integer","minimum":1},"draft":{"type":"object","properties":{"for_humans":{"type":"string","minLength":1,"maxLength":80000},"skill":{"type":"string","minLength":1,"maxLength":40000}},"required":["for_humans","skill"],"additionalProperties":false},"skill_tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"maxItems":50},"title":{"type":"string","minLength":1,"maxLength":200},"excerpt":{"type":"string","maxLength":2000}},"required":["action","revision","draft","skill_tags","title","excerpt"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["resume_review"]},"revision":{"type":"integer","minimum":1}},"required":["action","revision"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["hold"]},"revision":{"type":"integer","minimum":1},"note":{"type":"string","maxLength":2000}},"required":["action","revision","note"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["request_changes"]},"revision":{"type":"integer","minimum":1},"note":{"type":"string","minLength":1,"maxLength":2000}},"required":["action","revision","note"],"additionalProperties":false},{"type":"object","properties":{"action":{"type":"string","enum":["publish"]},"revision":{"type":"integer","minimum":1}},"required":["action","revision"],"additionalProperties":false}]}}}},"responses":{"200":{"description":"Private authoring snapshot. Draft content never enters the public catalog.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthoringSession"}}}},"400":{"description":"Invalid request.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Sign in required.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Admin only.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Session or source event not found.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Stale revision, invalid transition or publication collision.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Author disabled or provider/persistence/files unavailable.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"default":{"description":"HTTP errors use Problem Details.","headers":{"X-Correlation-ID":{"description":"Opaque UUID v4 support ID; matches the request log and Problem correlationId.","schema":{"type":"string","format":"uuid"}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}}}