Endpoints
This page describes the functional endpoint groups and what each route is responsible for.
Webhooks
POST /api/webhooks/githubReceives GitHub issue comment events and dispatches task creation.
Expected behavior:
- Valid signature + valid command -> create task.
- Invalid signature or unsupported payload -> reject request.
Auth and session
GET /api/auth/githubGET /api/auth/github/callbackGET /api/auth/github/installedGET /api/auth/diagnosticsPOST /api/auth/logoutThese routes handle GitHub OAuth sign-in, installation handoff, and auth diagnostics.
Tasks
GET /api/tasksPOST /api/tasksGET /api/tasks/historyGET /api/tasks/:id/statusPOST /api/tasks/:id/retryPOST /api/tasks/:id/stopGET /api/tasks: list tasksPOST /api/tasks: create task (internal)GET /api/tasks/history: task feed/history viewGET /api/tasks/:id/status: fetch current task statusPOST /api/tasks/:id/retry: retry a failed taskPOST /api/tasks/:id/stop: request cancellation/stop
Recommended response model:
- Return consistent task identifiers and status enum values.
- Include timestamps for queued, started, and completed states.
- Include error payload on failure transitions.
Callback
POST /api/callbacks/completeReceives task completion signals from worker containers.
Expected callback payload fields typically include task id, status, and optional metadata such as PR URL.
Config
GET /api/configPUT /api/configPUT /api/config/credentialsGET /api/config/provider-credentialsPUT /api/config/provider-credentialsPUT /api/config/flyGET /api/config/providersPOST /api/config/validate/anthropicPOST /api/config/validate/flyGET /api/config: load user config from D1PUT /api/config: update user config in D1- Provider credential routes: configure key status and secret writes
- Validation routes: verify provider and Fly credentials before runtime
GitHub data
GET /api/github/summaryGET /api/github/repositoriesGET /api/github/installationsGET /api/github/orgsGET /api/github/profileGET /api/github/issues/:owner/:repo/:numberThese routes drive authenticated UI data for installations, repositories, and issue context.
Ops and health
GET /api/startup/checkGET /api/rate-limitGET /api/startup/check: required env and D1 readiness checksGET /api/rate-limit: current GitHub API rate limit information
Error handling guidance
- Use
400for malformed request payloads. - Use
401/403for auth and permission failures. - Use
404when task or config target is missing. - Use
5xxonly for genuine server/runtime failures.