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: API specification servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: original-concepts description: Per-user Original Concepts account connection and publishing 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" /oc/referral/events: get: operationId: getOCReferralEvents tags: [original-concepts] summary: List the signed-in user's event-based OC offer options security: - bearerAuth: [] responses: "200": description: Server-verified event associations and eligibility content: application/json: schema: $ref: "#/components/schemas/OCReferralEventList" "401": description: Quest sign-in required "403": description: Account role is not eligible /oc/referral/start: post: operationId: startOCEventReferral tags: [original-concepts] summary: Create an event-bound OC referral after an explicit user action security: - bearerAuth: [] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/OCReferralStartInput" responses: "200": description: Referral URL with saved profile prefill and a verifiable event reference content: application/json: schema: $ref: "#/components/schemas/OCReferralStartResponse" "400": description: Invalid event "403": description: Event association or eligibility could not be verified "409": description: One-time offer already assigned to another event or entry "503": description: Event-benefit verification is unavailable /integrations/oc/referral/eligibility: post: operationId: verifyOCEventBenefit tags: [original-concepts] summary: Bind an OC client and check its current event-based automation eligibility description: OC server only. Re-read current Quest records before every automation run. Any error must fail closed. security: - ocBridgeAuth: [] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/OCBenefitVerificationInput" responses: "200": description: Current event context and eligibility, not a paid Gold subscription entitlement content: application/json: schema: $ref: "#/components/schemas/OCBenefitVerificationResponse" "401": description: OC integration authorization required "403": description: OC client or verified email does not match "404": description: Referral reference not found "409": description: Benefit already bound or revoked "503": description: Could not verify eligibility; do not grant automation access /oc/account/connect: post: operationId: startOCAccountConnection tags: [original-concepts] summary: Start a per-user OC authorization security: - bearerAuth: [] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/OCAccountConnectInput" responses: "200": description: Authorization URL for the OC OAuth consent screen content: application/json: schema: $ref: "#/components/schemas/OCAccountConnectResponse" "400": description: Invalid return destination content: application/json: schema: $ref: "#/components/schemas/ApiError" "401": description: Quest sign-in required content: application/json: schema: $ref: "#/components/schemas/ApiError" "503": description: OC OAuth is not configured content: application/json: schema: $ref: "#/components/schemas/ApiError" /oc/account/callback: get: operationId: completeOCAccountConnection tags: [original-concepts] summary: Receive the OC OAuth callback parameters: - name: code in: query required: false schema: type: string - name: state in: query required: true schema: type: string - name: error in: query required: false schema: type: string responses: "302": description: Redirect to the Quest account page with a connection outcome "400": description: Invalid or expired authorization state /oc/account/status: get: operationId: getOCAccountStatus tags: [original-concepts] summary: Get the signed-in user's OC connection security: - bearerAuth: [] responses: "200": description: Connection status and selected brand kit content: application/json: schema: $ref: "#/components/schemas/OCAccountStatus" "401": description: Quest sign-in required content: application/json: schema: $ref: "#/components/schemas/ApiError" /oc/account/brand-kits: get: operationId: getOCBrandKits tags: [original-concepts] summary: List the signed-in user's OC brand kits security: - bearerAuth: [] responses: "200": description: OC brand kits the user is allowed to access content: application/json: schema: $ref: "#/components/schemas/OCBrandKitList" "401": description: Quest sign-in or OC connection required content: application/json: schema: $ref: "#/components/schemas/ApiError" /oc/account/brand-kit: get: operationId: getSelectedOCBrandKit tags: [original-concepts] summary: Get the selected OC brand kit's identity and media security: - bearerAuth: [] responses: "200": description: Selected brand kit details content: application/json: schema: $ref: "#/components/schemas/OCSelectedBrandKit" "401": description: Quest sign-in or OC connection required content: application/json: schema: $ref: "#/components/schemas/ApiError" "409": description: No brand kit has been selected content: application/json: schema: $ref: "#/components/schemas/ApiError" put: operationId: selectOCBrandKit tags: [original-concepts] summary: Select a brand kit the connected OC user can access security: - bearerAuth: [] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/OCBrandKitSelectionInput" responses: "200": description: Selected brand kit and its details content: application/json: schema: $ref: "#/components/schemas/OCBrandKitSelectionResponse" "400": description: Invalid brand kit identifier content: application/json: schema: $ref: "#/components/schemas/ApiError" "401": description: Quest sign-in or OC connection required content: application/json: schema: $ref: "#/components/schemas/ApiError" /oc/account/publish: post: operationId: publishOCBrandKitPost tags: [original-concepts] summary: Publish a user-approved post through the selected OC brand kit security: - bearerAuth: [] requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/OCBrandKitPostInput" responses: "200": description: Per-account publishing results content: application/json: schema: $ref: "#/components/schemas/OCBrandKitPostResponse" "400": description: Invalid post request or media selection content: application/json: schema: $ref: "#/components/schemas/ApiError" "401": description: Quest sign-in or OC connection required content: application/json: schema: $ref: "#/components/schemas/ApiError" "403": description: A selected social target is not available to this OC user content: application/json: schema: $ref: "#/components/schemas/ApiError" "409": description: An idempotent publish request is already being processed content: application/json: schema: $ref: "#/components/schemas/ApiError" /oc/account/connection: delete: operationId: disconnectOCAccount tags: [original-concepts] summary: Revoke and remove the signed-in user's OC authorization security: - bearerAuth: [] responses: "200": description: Quest-side connection removal result content: application/json: schema: $ref: "#/components/schemas/OCAccountDisconnectResponse" "401": description: Quest sign-in required content: application/json: schema: $ref: "#/components/schemas/ApiError" components: securitySchemes: ocBridgeAuth: type: http scheme: bearer description: Existing Quest-OC shared service authorization, never browser-visible bearerAuth: type: http scheme: bearer bearerFormat: Firebase ID token schemas: HealthStatus: type: object properties: status: type: string required: - status ApiError: type: object properties: message: type: string code: type: string required: [message] OCReferralEventData: type: object properties: competitionId: type: integer title: type: string category: type: string status: type: string startDate: type: [string, "null"] endDate: type: [string, "null"] contestantId: type: [integer, "null"] required: [competitionId, title, category, status, startDate, endDate, contestantId] OCReferralEventOption: allOf: - $ref: "#/components/schemas/OCReferralEventData" - type: object properties: eligible: type: boolean reason: type: string message: type: string required: [eligible, reason, message] OCReferralEventList: type: object properties: role: type: string enum: [artist, host] claimedCompetitionId: type: [integer, "null"] events: type: array items: $ref: "#/components/schemas/OCReferralEventOption" required: [role, claimedCompetitionId, events] OCReferralStartInput: type: object additionalProperties: false properties: competitionId: type: integer minimum: 1 required: [competitionId] OCReferralStartResponse: type: object properties: referralUrl: type: string format: uri event: $ref: "#/components/schemas/OCReferralEventData" required: [referralUrl, event] OCBenefitVerificationInput: type: object additionalProperties: false properties: referralId: type: string pattern: "^[A-Za-z0-9_-]{43}$" ocAccountId: type: string minLength: 1 maxLength: 256 verifiedEmail: type: string format: email required: [referralId, ocAccountId, verifiedEmail] OCBenefitVerificationResponse: type: object properties: eligible: type: boolean reason: type: string referralId: type: string role: type: string enum: [artist, host] questUserId: type: string ocAccountId: type: string offer: type: object properties: code: type: string plan: type: string feature: type: string planMonthlyPriceCents: type: integer currency: type: string required: [code, plan, feature, planMonthlyPriceCents, currency] checkedAt: type: string format: date-time expiresAt: type: [string, "null"] revokedAt: type: [string, "null"] event: anyOf: - $ref: "#/components/schemas/OCReferralEventData" - type: "null" profile: type: object properties: email: type: [string, "null"] displayName: type: [string, "null"] stageName: type: [string, "null"] required: [email, displayName, stageName] required: [eligible, reason, referralId, role, questUserId, ocAccountId, offer, checkedAt, expiresAt, revokedAt, event, profile] OCAccountConnectInput: type: object properties: returnTo: type: string enum: [/thequest/dashboard] required: [returnTo] OCAccountConnectResponse: type: object properties: authorizationUrl: type: string format: uri required: [authorizationUrl] OCAccount: type: object properties: id: type: string displayName: type: string required: [id, displayName] OCAccountStatus: type: object properties: connected: type: boolean account: anyOf: - $ref: "#/components/schemas/OCAccount" - type: "null" selectedBrandKitId: type: ["string", "null"] selectedBrandKitName: type: ["string", "null"] scopes: type: array items: type: string connectedAt: type: ["string", "null"] format: date-time required: [connected, account, selectedBrandKitId, selectedBrandKitName, scopes, connectedAt] OCBrandKitSummary: type: object properties: id: type: string name: type: string businessName: type: string brandSlug: type: string logoUrl: type: string format: uri primaryColor: type: string required: [id, name] OCBrandKitList: type: object properties: brandKits: type: array items: $ref: "#/components/schemas/OCBrandKitSummary" required: [brandKits] OCBrandKitIdentity: type: object properties: businessName: type: string brandSlug: type: string tagline: type: string description: type: string logoUrl: type: string format: uri websiteUrl: type: string format: uri primaryColor: type: string secondaryColor: type: string accentColor: type: string OCBrandKitMedia: type: object properties: id: type: string name: type: string kind: type: string enum: [image, video] mimeType: type: string previewUrl: type: string format: uri canPublish: type: boolean required: [id, name, kind, mimeType, previewUrl, canPublish] OCBrandKitSocialAccount: type: object properties: id: type: string platform: type: string displayName: type: string canPublish: type: boolean required: [id, platform, displayName, canPublish] OCBrandKit: type: object properties: id: type: string name: type: string identity: $ref: "#/components/schemas/OCBrandKitIdentity" media: type: array items: $ref: "#/components/schemas/OCBrandKitMedia" socialAccounts: type: array items: $ref: "#/components/schemas/OCBrandKitSocialAccount" required: [id, name, identity, media, socialAccounts] OCSelectedBrandKit: type: object properties: brandKit: $ref: "#/components/schemas/OCBrandKit" required: [brandKit] OCBrandKitSelectionInput: type: object properties: brandKitId: type: string minLength: 1 maxLength: 256 required: [brandKitId] OCBrandKitSelectionResponse: type: object properties: selectedBrandKitId: type: string brandKit: $ref: "#/components/schemas/OCBrandKit" required: [selectedBrandKitId, brandKit] OCBrandKitPostInput: type: object properties: targetIds: type: array items: type: string minItems: 1 maxItems: 20 caption: type: string minLength: 1 maxLength: 2200 mediaAssetId: type: string idempotencyKey: type: string format: uuid required: [targetIds, caption, idempotencyKey] OCBrandKitPostResult: type: object properties: targetId: type: string platform: type: string success: type: boolean postUrl: type: string format: uri error: type: string required: [targetId, platform, success] OCBrandKitPostResponse: type: object properties: success: type: boolean results: type: array items: $ref: "#/components/schemas/OCBrandKitPostResult" required: [success, results] OCAccountDisconnectResponse: type: object properties: disconnected: type: boolean revocationConfirmed: type: boolean required: [disconnected, revocationConfirmed]