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: Orbit API specification servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: users description: User operations - name: spheres description: Sphere (room) operations - name: members description: Sphere membership operations - name: logs description: Daily log operations - name: interactions description: Reaction and nudge operations 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/sync: post: operationId: syncUser tags: [users] summary: Sync current user from Clerk requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UserInput" responses: "200": description: User synced content: application/json: schema: $ref: "#/components/schemas/User" /users/me: get: operationId: getMe tags: [users] summary: Get current user profile responses: "200": description: Current user content: application/json: schema: $ref: "#/components/schemas/User" "401": description: Unauthorized /spheres: get: operationId: listSpheres tags: [spheres] summary: List spheres current user is a member of responses: "200": description: List of spheres content: application/json: schema: type: array items: $ref: "#/components/schemas/Sphere" post: operationId: createSphere tags: [spheres] summary: Create a new sphere requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SphereInput" responses: "201": description: Sphere created content: application/json: schema: $ref: "#/components/schemas/Sphere" /spheres/preview/{inviteCode}: get: operationId: previewSphere tags: [spheres] summary: Preview a sphere by invite code before joining parameters: - name: inviteCode in: path required: true schema: type: string responses: "200": description: Sphere preview content: application/json: schema: $ref: "#/components/schemas/SpherePreview" "404": description: Sphere not found /spheres/join: post: operationId: joinSphere tags: [spheres] summary: Join a sphere via invite code requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/JoinSphereInput" responses: "200": description: Joined sphere content: application/json: schema: $ref: "#/components/schemas/Sphere" "404": description: Invite code not found /spheres/{sphereId}: get: operationId: getSphere tags: [spheres] summary: Get sphere details parameters: - name: sphereId in: path required: true schema: type: integer responses: "200": description: Sphere details content: application/json: schema: $ref: "#/components/schemas/Sphere" "403": description: Not a member "404": description: Not found delete: operationId: deleteSphere tags: [spheres] summary: Delete a sphere (admin only) parameters: - name: sphereId in: path required: true schema: type: integer responses: "204": description: Deleted /spheres/{sphereId}/summary: get: operationId: getSphereSummary tags: [spheres] summary: Get daily summary for a sphere parameters: - name: sphereId in: path required: true schema: type: integer responses: "200": description: Sphere summary content: application/json: schema: $ref: "#/components/schemas/SphereSummary" /spheres/{sphereId}/activity: get: operationId: getSphereActivity tags: [spheres] summary: Get recent activity feed for a sphere parameters: - name: sphereId in: path required: true schema: type: integer responses: "200": description: Activity feed content: application/json: schema: type: array items: $ref: "#/components/schemas/ActivityItem" /spheres/{sphereId}/members: get: operationId: listMembers tags: [members] summary: List members of a sphere parameters: - name: sphereId in: path required: true schema: type: integer responses: "200": description: List of members content: application/json: schema: type: array items: $ref: "#/components/schemas/Member" /spheres/{sphereId}/members/{userId}: delete: operationId: removeMember tags: [members] summary: Remove a member from a sphere (admin only) parameters: - name: sphereId in: path required: true schema: type: integer - name: userId in: path required: true schema: type: integer responses: "204": description: Member removed "403": description: Forbidden /spheres/{sphereId}/logs: get: operationId: listLogs tags: [logs] summary: List daily logs for a sphere parameters: - name: sphereId in: path required: true schema: type: integer responses: "200": description: List of logs content: application/json: schema: type: array items: $ref: "#/components/schemas/DailyLog" post: operationId: createLog tags: [logs] summary: Post a daily standup log parameters: - name: sphereId in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/LogInput" responses: "201": description: Log created content: application/json: schema: $ref: "#/components/schemas/DailyLog" /spheres/{sphereId}/logs/{logId}: patch: operationId: updateLog tags: [logs] summary: Update a daily log (own logs only) parameters: - name: sphereId in: path required: true schema: type: integer - name: logId in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/LogUpdate" responses: "200": description: Updated log content: application/json: schema: $ref: "#/components/schemas/DailyLog" "403": description: Forbidden "404": description: Not found delete: operationId: deleteLog tags: [logs] summary: Delete a daily log parameters: - name: sphereId in: path required: true schema: type: integer - name: logId in: path required: true schema: type: integer responses: "204": description: Deleted "403": description: Forbidden /spheres/{sphereId}/logs/{logId}/interactions: get: operationId: listInteractions tags: [interactions] summary: Get interactions for a log parameters: - name: sphereId in: path required: true schema: type: integer - name: logId in: path required: true schema: type: integer responses: "200": description: List of interactions content: application/json: schema: type: array items: $ref: "#/components/schemas/Interaction" post: operationId: createInteraction tags: [interactions] summary: Add a reaction or nudge to a log parameters: - name: sphereId in: path required: true schema: type: integer - name: logId in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/InteractionInput" responses: "201": description: Interaction created content: application/json: schema: $ref: "#/components/schemas/Interaction" /spheres/{sphereId}/logs/{logId}/interactions/{interactionId}: delete: operationId: deleteInteraction tags: [interactions] summary: Remove an interaction parameters: - name: sphereId in: path required: true schema: type: integer - name: logId in: path required: true schema: type: integer - name: interactionId in: path required: true schema: type: integer responses: "204": description: Deleted "403": description: Forbidden components: schemas: HealthStatus: type: object required: [status] properties: status: type: string User: type: object required: [id, clerkId, name, email, createdAt] properties: id: type: integer clerkId: type: string name: type: string email: type: string avatarUrl: type: ["string", "null"] createdAt: type: string UserInput: type: object required: [clerkId, name, email] properties: clerkId: type: string name: type: string email: type: string avatarUrl: type: ["string", "null"] Sphere: type: object required: [id, name, inviteCode, createdById, createdAt, memberCount] properties: id: type: integer name: type: string inviteCode: type: string createdById: type: integer createdAt: type: string memberCount: type: integer SphereInput: type: object required: [name] properties: name: type: string minLength: 1 SpherePreview: type: object required: [id, name, memberCount] properties: id: type: integer name: type: string memberCount: type: integer JoinSphereInput: type: object required: [inviteCode] properties: inviteCode: type: string SphereSummary: type: object required: [totalMembers, postedToday, pendingToday, totalLogs] properties: totalMembers: type: integer postedToday: type: integer pendingToday: type: integer totalLogs: type: integer ActivityItem: type: object required: [id, type, userId, sphereId, logId, createdAt, user] properties: id: type: integer type: type: string userId: type: integer sphereId: type: integer logId: type: integer content: type: ["string", "null"] createdAt: type: string user: $ref: "#/components/schemas/User" Member: type: object required: [id, userId, sphereId, role, user] properties: id: type: integer userId: type: integer sphereId: type: integer role: type: string user: $ref: "#/components/schemas/User" DailyLog: type: object required: [id, userId, sphereId, content, status, createdAt, user, interactionCount] properties: id: type: integer userId: type: integer sphereId: type: integer content: type: string status: type: string createdAt: type: string user: $ref: "#/components/schemas/User" interactionCount: type: integer LogInput: type: object required: [content] properties: content: type: string status: type: string LogUpdate: type: object properties: content: type: string status: type: string Interaction: type: object required: [id, logId, userId, type, createdAt, user] properties: id: type: integer logId: type: integer userId: type: integer type: type: string emoji: type: ["string", "null"] createdAt: type: string user: $ref: "#/components/schemas/User" InteractionInput: type: object required: [type] properties: type: type: string emoji: type: ["string", "null"]