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: LoopSpace API - Beta feedback collection platform servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: users description: User profile operations - name: projects description: Project operations - name: pages description: Page operations - name: feedback description: Feedback operations - name: dashboard description: Dashboard and analytics operations - name: ai description: AI-powered feedback analysis 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" /users/me: get: operationId: getMe tags: [users] summary: Get current user profile responses: "200": description: User profile content: application/json: schema: $ref: "#/components/schemas/User" "401": description: Unauthorized put: operationId: updateMe tags: [users] summary: Update current user profile requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UserInput" responses: "200": description: Updated user profile content: application/json: schema: $ref: "#/components/schemas/User" "401": description: Unauthorized /projects: get: operationId: listProjects tags: [projects] summary: List all projects for current user responses: "200": description: List of projects content: application/json: schema: type: array items: $ref: "#/components/schemas/Project" "401": description: Unauthorized post: operationId: createProject tags: [projects] summary: Create a new project requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ProjectInput" responses: "201": description: Created project content: application/json: schema: $ref: "#/components/schemas/Project" "401": description: Unauthorized /projects/{projectId}: get: operationId: getProject tags: [projects] summary: Get a project by ID parameters: - name: projectId in: path required: true schema: type: number responses: "200": description: Project content: application/json: schema: $ref: "#/components/schemas/Project" "404": description: Not found patch: operationId: updateProject tags: [projects] summary: Update a project parameters: - name: projectId in: path required: true schema: type: number requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ProjectUpdate" responses: "200": description: Updated project content: application/json: schema: $ref: "#/components/schemas/Project" "404": description: Not found delete: operationId: deleteProject tags: [projects] summary: Delete a project parameters: - name: projectId in: path required: true schema: type: number responses: "204": description: Deleted /projects/{projectId}/pages: get: operationId: listPages tags: [pages] summary: List all pages in a project parameters: - name: projectId in: path required: true schema: type: number responses: "200": description: List of pages content: application/json: schema: type: array items: $ref: "#/components/schemas/Page" post: operationId: createPage tags: [pages] summary: Create a new page in a project parameters: - name: projectId in: path required: true schema: type: number requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/PageInput" responses: "201": description: Created page content: application/json: schema: $ref: "#/components/schemas/Page" /projects/{projectId}/pages/{pageId}: get: operationId: getPage tags: [pages] summary: Get a page by ID parameters: - name: projectId in: path required: true schema: type: number - name: pageId in: path required: true schema: type: number responses: "200": description: Page content: application/json: schema: $ref: "#/components/schemas/Page" "404": description: Not found patch: operationId: updatePage tags: [pages] summary: Update a page parameters: - name: projectId in: path required: true schema: type: number - name: pageId in: path required: true schema: type: number requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/PageUpdate" responses: "200": description: Updated page content: application/json: schema: $ref: "#/components/schemas/Page" "404": description: Not found delete: operationId: deletePage tags: [pages] summary: Delete a page parameters: - name: projectId in: path required: true schema: type: number - name: pageId in: path required: true schema: type: number responses: "204": description: Deleted /feedback: post: operationId: submitFeedback tags: [feedback] summary: Submit feedback for a page (public, via iframe token) requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/FeedbackInput" responses: "201": description: Submitted content: application/json: schema: $ref: "#/components/schemas/Feedback" "404": description: Page not found /projects/{projectId}/feedback: get: operationId: listProjectFeedback tags: [feedback] summary: List all feedback for a project parameters: - name: projectId in: path required: true schema: type: number responses: "200": description: List of feedback content: application/json: schema: type: array items: $ref: "#/components/schemas/Feedback" /projects/{projectId}/pages/{pageId}/feedback: get: operationId: listPageFeedback tags: [feedback] summary: List all feedback for a page parameters: - name: projectId in: path required: true schema: type: number - name: pageId in: path required: true schema: type: number responses: "200": description: List of feedback content: application/json: schema: type: array items: $ref: "#/components/schemas/Feedback" /feedback/{feedbackId}: patch: operationId: updateFeedback tags: [feedback] summary: Update feedback status parameters: - name: feedbackId in: path required: true schema: type: number requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/FeedbackUpdate" responses: "200": description: Updated feedback content: application/json: schema: $ref: "#/components/schemas/Feedback" "404": description: Not found delete: operationId: deleteFeedback tags: [feedback] summary: Delete feedback parameters: - name: feedbackId in: path required: true schema: type: number responses: "204": description: Deleted /projects/{projectId}/dashboard: get: operationId: getProjectDashboard tags: [dashboard] summary: Get dashboard summary for a project parameters: - name: projectId in: path required: true schema: type: number responses: "200": description: Dashboard summary content: application/json: schema: $ref: "#/components/schemas/ProjectDashboard" /dashboard/summary: get: operationId: getGlobalDashboard tags: [dashboard] summary: Get global dashboard summary across all projects responses: "200": description: Global dashboard summary content: application/json: schema: $ref: "#/components/schemas/GlobalDashboard" /projects/{projectId}/analysis: get: operationId: getProjectAnalysis tags: [ai] summary: Get AI-powered analysis of feedback for a project parameters: - name: projectId in: path required: true schema: type: number responses: "200": description: AI feedback analysis content: application/json: schema: $ref: "#/components/schemas/FeedbackAnalysis" "400": description: Not enough feedback to analyze "401": description: Unauthorized "404": description: Project not found components: schemas: HealthStatus: type: object properties: status: type: string required: - status User: type: object required: [id, clerkId, email, createdAt] properties: id: type: number clerkId: type: string email: type: string name: type: ["string", "null"] avatarUrl: type: ["string", "null"] createdAt: type: string UserInput: type: object properties: name: type: string avatarUrl: type: string Project: type: object required: [id, userId, name, createdAt, updatedAt] properties: id: type: number userId: type: number name: type: string description: type: ["string", "null"] createdAt: type: string updatedAt: type: string pageCount: type: number feedbackCount: type: number openCount: type: number ProjectInput: type: object required: [name] properties: name: type: string minLength: 1 description: type: string ProjectUpdate: type: object properties: name: type: string minLength: 1 description: type: string Page: type: object required: [id, projectId, name, iframeToken, createdAt, updatedAt] properties: id: type: number projectId: type: number name: type: string description: type: ["string", "null"] iframeToken: type: string iframeUrl: type: string createdAt: type: string updatedAt: type: string feedbackCount: type: number openCount: type: number PageInput: type: object required: [name] properties: name: type: string minLength: 1 description: type: string PageUpdate: type: object properties: name: type: string minLength: 1 description: type: string Feedback: type: object required: [id, pageId, projectId, title, status, createdAt, updatedAt] properties: id: type: number pageId: type: number projectId: type: number title: type: string description: type: ["string", "null"] submitterName: type: ["string", "null"] submitterEmail: type: ["string", "null"] priority: type: string enum: [low, medium, high] status: type: string enum: [open, in_progress, fixed, ignored] createdAt: type: string updatedAt: type: string FeedbackInput: type: object required: [pageToken, title] properties: pageToken: type: string title: type: string minLength: 1 description: type: string submitterName: type: string submitterEmail: type: string priority: type: string enum: [low, medium, high] FeedbackUpdate: type: object properties: title: type: string minLength: 1 description: type: string priority: type: string enum: [low, medium, high] status: type: string enum: [open, in_progress, fixed, ignored] PageFeedbackSummary: type: object required: [pageId, pageName, total, open, inProgress, fixed, ignored] properties: pageId: type: number pageName: type: string total: type: number open: type: number inProgress: type: number fixed: type: number ignored: type: number ProjectDashboard: type: object required: [projectId, projectName, totalFeedback, openCount, inProgressCount, fixedCount, ignoredCount, byPage, recentFeedback] properties: projectId: type: number projectName: type: string totalFeedback: type: number openCount: type: number inProgressCount: type: number fixedCount: type: number ignoredCount: type: number byPage: type: array items: $ref: "#/components/schemas/PageFeedbackSummary" recentFeedback: type: array items: $ref: "#/components/schemas/Feedback" GlobalDashboard: type: object required: [totalProjects, totalFeedback, openCount, inProgressCount, fixedCount, ignoredCount, topProjects] properties: totalProjects: type: number totalFeedback: type: number openCount: type: number inProgressCount: type: number fixedCount: type: number ignoredCount: type: number topProjects: type: array items: $ref: "#/components/schemas/Project" AnalysisIssue: type: object required: [title, description, priority, mentionCount] properties: title: type: string description: type: string priority: type: string enum: [critical, high, medium, low] mentionCount: type: number AnalysisSuggestion: type: object required: [title, description, impact] properties: title: type: string description: type: string impact: type: string enum: [high, medium, low] FeedbackAnalysis: type: object required: [projectId, projectName, feedbackCount, executiveSummary, overallSentiment, topIssues, whatUsersLove, suggestions, generatedAt] properties: projectId: type: number projectName: type: string feedbackCount: type: number executiveSummary: type: string overallSentiment: type: string topIssues: type: array items: $ref: "#/components/schemas/AnalysisIssue" whatUsersLove: type: array items: type: string suggestions: type: array items: $ref: "#/components/schemas/AnalysisSuggestion" generatedAt: type: string