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: ZARITH Executive AI Agent API servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: auth description: Authentication operations - name: tasks description: Task management - name: chat description: AI chat and agent interactions - name: dashboard description: Dashboard summary data paths: /auth/send-otp: post: operationId: sendOtp tags: [auth] summary: Send OTP code to email via Supabase requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SendOtpBody" responses: "200": description: OTP sent content: application/json: schema: $ref: "#/components/schemas/OtpSentResponse" "400": description: Invalid email /auth/verify-otp: post: operationId: verifyOtp tags: [auth] summary: Verify OTP code and return session requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/VerifyOtpBody" responses: "200": description: Session data content: application/json: schema: $ref: "#/components/schemas/SessionResponse" "401": description: Invalid OTP /healthz: get: operationId: healthCheck tags: [health] summary: Health check responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /tasks: get: operationId: listTasks tags: [tasks] summary: List all tasks parameters: - name: status in: query schema: type: string enum: [pending, in_progress, completed, failed] - name: limit in: query schema: type: integer default: 50 responses: "200": description: List of tasks content: application/json: schema: type: array items: $ref: "#/components/schemas/Task" post: operationId: createTask tags: [tasks] summary: Create a new task requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateTaskBody" responses: "201": description: Task created content: application/json: schema: $ref: "#/components/schemas/Task" /tasks/{id}: get: operationId: getTask tags: [tasks] summary: Get task by ID parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Task details content: application/json: schema: $ref: "#/components/schemas/Task" "404": description: Task not found patch: operationId: updateTask tags: [tasks] summary: Update a task parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateTaskBody" responses: "200": description: Task updated content: application/json: schema: $ref: "#/components/schemas/Task" delete: operationId: deleteTask tags: [tasks] summary: Delete a task parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Task deleted /chat: post: operationId: sendMessage tags: [chat] summary: Send a message to the ZARITH agent requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SendMessageBody" responses: "200": description: Agent response content: application/json: schema: $ref: "#/components/schemas/AgentMessage" /chat/history: get: operationId: getChatHistory tags: [chat] summary: Get chat message history parameters: - name: limit in: query schema: type: integer default: 50 responses: "200": description: Chat history content: application/json: schema: type: array items: $ref: "#/components/schemas/ChatMessage" /dashboard/summary: get: operationId: getDashboardSummary tags: [dashboard] summary: Get dashboard summary stats responses: "200": description: Summary data content: application/json: schema: $ref: "#/components/schemas/DashboardSummary" /dashboard/activity: get: operationId: getRecentActivity tags: [dashboard] summary: Get recent activity feed parameters: - name: limit in: query schema: type: integer default: 10 responses: "200": description: Recent activity content: application/json: schema: type: array items: $ref: "#/components/schemas/ActivityItem" components: schemas: SendOtpBody: type: object properties: email: type: string format: email required: - email OtpSentResponse: type: object properties: success: type: boolean message: type: string required: - success - message VerifyOtpBody: type: object properties: email: type: string format: email token: type: string required: - email - token SessionResponse: type: object properties: success: type: boolean userId: type: string nullable: true email: type: string nullable: true accessToken: type: string nullable: true required: - success HealthStatus: type: object properties: status: type: string required: - status Task: type: object properties: id: type: integer title: type: string description: type: string nullable: true status: type: string enum: [pending, in_progress, completed, failed] priority: type: string enum: [low, medium, high, critical] createdAt: type: string format: date-time updatedAt: type: string format: date-time required: - id - title - status - priority - createdAt - updatedAt CreateTaskBody: type: object properties: title: type: string description: type: string nullable: true priority: type: string enum: [low, medium, high, critical] default: medium required: - title UpdateTaskBody: type: object properties: title: type: string description: type: string nullable: true status: type: string enum: [pending, in_progress, completed, failed] priority: type: string enum: [low, medium, high, critical] SendMessageBody: type: object properties: content: type: string sessionId: type: string nullable: true required: - content AgentMessage: type: object properties: id: type: integer role: type: string enum: [user, assistant] content: type: string createdAt: type: string format: date-time isThinking: type: boolean required: - id - role - content - createdAt - isThinking ChatMessage: type: object properties: id: type: integer role: type: string enum: [user, assistant] content: type: string createdAt: type: string format: date-time required: - id - role - content - createdAt DashboardSummary: type: object properties: totalTasks: type: integer completedTasks: type: integer pendingTasks: type: integer inProgressTasks: type: integer totalMessages: type: integer agentStatus: type: string enum: [idle, thinking, executing] required: - totalTasks - completedTasks - pendingTasks - inProgressTasks - totalMessages - agentStatus ActivityItem: type: object properties: id: type: integer type: type: string enum: [task_created, task_completed, task_failed, message_sent, agent_response] description: type: string metadata: type: object nullable: true createdAt: type: string format: date-time required: - id - type - description - createdAt