Skip to main content

API reference

All routes live under /api/. Responses carry { success: boolean, … }.

:::note Enumerated from the source The previous README listed 21 routes; ~40 route directories exist on disk. This page lists what is actually there. Request and response shapes are summarised — read the handler for exact fields. :::

Authentication

MethodRoutePurpose
*/api/auth/[...nextauth]NextAuth handler — GitHub and Google
POST/api/auth/signupCredentials sign-up
POST/api/auth/send-otpOTP email — legacy, not wired up
POST/api/auth/setcookieSession cookie helper

Groups

MethodRoutePurpose
GET/api/groupsList groups
GET/api/groups/[groupId]Group detail
GET/api/my-groupsCaller's groups
POST/api/create-group-dataCreate a group
POST/api/add-group-memberAdd a member
GET/api/check-group-memberMembership check
POST/api/send-inviteEmail or link invite
POST/api/guest-modeGuest access
GET/api/group-live-urlLive session URL

Chat

MethodRoutePurpose
POST/api/save-group-messagePersist a group message
GET/POST/api/direct-messageDM history and send
GET/api/direct-message/unreadUnread counts by peer

Messages persist over HTTP and broadcast over WebSocket. Both paths must succeed for a message to be both seen live and durable.

Users

MethodRoutePurpose
GET/PATCH/api/profileRead and update profile
POST/api/profile/avatarAvatar upload → S3
GET/api/check-userExistence check
GET/api/check-phone-numberPhone availability
GET/api/lookup-userLookup by identifier
GET/api/get-user-id, /api/get-user-numberIdentity helpers
POST/api/set-phoneSet phone number
GET/api/friends, /api/friend-searchSocial graph

GitHub

MethodRoutePurpose
POST/api/github/linkLink a repo to a group
GET/api/github/statusConnection status
POST/api/github/collaboratorInvite as collaborator
GET/api/github/invitationsPending invitations

Access tokens are encrypted at rest with ENCRYPTION_KEY.

Files

MethodRoutePurpose
GET/api/filesList repo files
GET/api/file-contentRead a file
POST/api/file-chunkChunked upload for large files
GET/api/file-downloadDownload
DELETE/api/delete-fileDelete
POST/api/save-coding-filesPersist editor state
GET/POST/api/trashSoft-delete and restore

Version control

MethodRoutePurpose
GET/POST/api/vcs/branchesList and create branches
GET/api/vcs/base-shaBase commit for a diff
POST/api/vcs/change-requestRaise a change request
POST/api/vcs/mergeMerge an approved CR
POST/api/vcs/rejectReject with a reason
POST/api/vcs/reconnectRe-establish a workspace
GET/POST/api/change-requestLegacy CR endpoint
POST/api/commit-changesCommit
GET/api/modified-filesWorking-tree changes
GET/api/rejected-crRejections for the caller

Heavy git operations delegate to the git microservice.

Workspace boards

MethodRoutePurpose
GET/PUT/api/workspace/[groupId]/ui-designUI design board
GET/PUT/api/workspace/[groupId]/mind-mapMind map
GET/PUT/api/workspace/[groupId]/db-schemaSchema designer
GET/PUT/api/workspace/[groupId]/planningPlanning data
*/api/workspace/[groupId]/planning/tasks/[taskId]Task CRUD

Graph boards store { nodes, edges } as JSON on WorkspaceBoard. PUT replaces the whole document, so the client debounces to avoid write storms.

Calls

MethodRoutePurpose
POST/api/calls/initiateStart a call and notify the callee
POST/api/calls/tokenMint a LiveKit access token
GET/PATCH/api/calls/[id]State: accept, reject, end
POST/api/calls/livekit-webhookLiveKit server events
POST/api/calls/push-subscribeWeb Push registration
GET/api/calls/healthConfiguration sanity check

The best-tested area of the codebase — 11 test files.

Other

MethodRoutePurpose
GET/api/notificationsNotification list
GET/POST/api/bug-report, /api/bug-report/[id]Bug reports → GitHub issues
POST/api/generate-readmeGroq-generated README
GET/api/testimonial-cardLanding page testimonials

Conventions

Success

{ "success": true, "data": {} }

Failure

{ "success": false, "error": "Human-readable reason" }
StatusMeaning
200OK
400Missing or invalid input
401Not signed in
403Signed in but not permitted
404Not found
500Server error

:::warning Authorization is not uniform Not every route enforces authorization the same way — some accept a userId parameter and trust it. Treat this page as a map of what exists, not a guarantee that each route is correctly guarded. See Security. :::