openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: Cold Case Cinema API servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: cinema description: Film discovery, taste signals, and story assets paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check description: Returns server health status responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /session: get: operationId: getSession tags: [cinema] summary: Get the signed-in user from the session cookie responses: "200": description: Current session user content: application/json: schema: $ref: "#/components/schemas/SessionUser" "401": description: Not signed in content: application/json: schema: $ref: "#/components/schemas/ApiError" post: operationId: login tags: [cinema] summary: Create or resume a username-only account requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/LoginInput" responses: "200": description: Signed-in session user content: application/json: schema: $ref: "#/components/schemas/SessionUser" delete: operationId: logout tags: [cinema] summary: Sign out and clear the session cookie responses: "200": description: Signed out content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /session/onboarding: post: operationId: completeOnboarding tags: [cinema] summary: Mark the one-time onboarding screen as seen responses: "200": description: Updated session user content: application/json: schema: $ref: "#/components/schemas/SessionUser" /profile: get: operationId: getCinemaProfile tags: [cinema] summary: Get the local viewer profile responses: "200": description: Viewer profile content: application/json: schema: $ref: "#/components/schemas/CinemaProfile" put: operationId: updateCinemaProfile tags: [cinema] summary: Update the viewer nickname requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ProfileInput" responses: "200": description: Updated viewer profile content: application/json: schema: $ref: "#/components/schemas/CinemaProfile" /pitch: get: operationId: getCurrentPitch tags: [cinema] summary: Get the current cold pitch responses: "200": description: Current film pitch content: application/json: schema: $ref: "#/components/schemas/PitchPacket" /pitch/next: post: operationId: getNextPitch tags: [cinema] summary: Research and create the next unpitched film requestBody: required: false content: application/json: schema: $ref: "#/components/schemas/NextPitchInput" responses: "200": description: Newly researched pitch content: application/json: schema: $ref: "#/components/schemas/PitchPacket" /verdict: post: operationId: saveVerdict tags: [cinema] summary: Save a watch or skip verdict and derive taste signals requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/VerdictInput" responses: "200": description: Verdict and learned signals content: application/json: schema: $ref: "#/components/schemas/VerdictResult" /review-draft: post: operationId: createReviewDraft tags: [cinema] summary: Generate a YouTube review description from a watched pitch requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ReviewDraftInput" responses: "200": description: YouTube review assets content: application/json: schema: $ref: "#/components/schemas/ReviewDraft" /archive: get: operationId: listPitchArchive tags: [cinema] summary: List recent pitches and verdicts responses: "200": description: Pitched film archive content: application/json: schema: type: array items: $ref: "#/components/schemas/ArchiveItem" /taste-signals: get: operationId: getTasteSignals tags: [cinema] summary: Get learned taste signals and a human explanation responses: "200": description: Current taste profile content: application/json: schema: $ref: "#/components/schemas/TasteProfile" components: schemas: HealthStatus: type: object properties: status: type: string required: [status] ApiError: type: object required: [error] properties: error: type: string LoginInput: type: object required: [username] properties: username: type: string minLength: 2 maxLength: 24 pattern: "^[a-zA-Z0-9_-]+$" SessionUser: type: object required: [username, onboarded, isNew] properties: username: type: string onboarded: type: boolean isNew: type: boolean CinemaProfile: type: object required: [nickname, pitchesSeen, watchCount, skipCount] properties: nickname: type: string pitchesSeen: type: number watchCount: type: number skipCount: type: number ProfileInput: type: object required: [nickname] properties: nickname: type: string minLength: 1 maxLength: 36 FilmStill: type: object required: [url, caption] properties: url: type: string caption: type: string WatchSource: type: object required: [label, url, detail] properties: label: type: string url: type: string detail: type: string FilmRatings: type: object properties: rottenTomatoes: type: string imdb: type: string PitchPacket: type: object required: - id - title - year - director - runtime - genres - logline - posterUrl - pitch - whyNow - stills - watchOptions - trailerUrl - titleCard - researchStatus properties: id: type: string title: type: string year: type: number director: type: string runtime: type: number genres: type: array items: type: string logline: type: string posterUrl: type: ["string", "null"] pitch: type: string whyNow: type: string stills: type: array minItems: 1 maxItems: 3 items: $ref: "#/components/schemas/FilmStill" watchOptions: type: array items: $ref: "#/components/schemas/WatchSource" trailerUrl: type: ["string", "null"] titleCard: type: string researchStatus: type: string enum: [live, sample] ratings: $ref: "#/components/schemas/FilmRatings" NextPitchInput: type: object properties: force: type: boolean VerdictInput: type: object required: [pitchId, verdict] properties: pitchId: type: string verdict: type: string enum: [watch, skip] reason: type: string maxLength: 420 TasteSignal: type: object required: [type, value, weight, direction] properties: type: type: string value: type: string weight: type: number direction: type: string enum: [positive, negative] VerdictResult: type: object required: [verdict, adaptationNote, signals] properties: verdict: type: string enum: [watch, skip] adaptationNote: type: string signals: type: array items: $ref: "#/components/schemas/TasteSignal" ReviewDraftInput: type: object required: [pitchId] properties: pitchId: type: string viewerNotes: type: string maxLength: 1200 ReviewDraft: type: object required: [youtubeDescription, titleCard, thumbnailPrompt] properties: youtubeDescription: type: string titleCard: type: string thumbnailPrompt: type: string ArchiveItem: type: object required: [id, title, year, genres, verdict, verdictReason, pitchedAt] properties: id: type: string title: type: string year: type: number genres: type: array items: type: string verdict: type: string enum: [watch, skip, pending] verdictReason: type: ["string", "null"] pitchedAt: type: string TasteProfile: type: object required: [summary, signals] properties: summary: type: string signals: type: array items: $ref: "#/components/schemas/TasteSignal"