REST API
import { Aside } from ‘@astrojs/starlight/components’;
All API endpoints are available at http://localhost:3000/api.
Authentication
Section titled “Authentication”All requests require a JWT token in the Authorization header and an organization ID in x-org-id:
Authorization: Bearer <token>x-org-id: <org-uuid>Get a token
Section titled “Get a token”curl -X POST http://localhost:3000/api/auth/login \ -H 'Content-Type: application/json' \ -d '{"email":"admin@acme.dev","password":"Admin1234!"}'Response:
{ "accessToken": "eyJ...", "orgs": [{ "id": "uuid", "name": "Acme" }]}Projects
Section titled “Projects”List projects
Section titled “List projects”GET /api/projectsCreate project
Section titled “Create project”POST /api/projectsContent-Type: application/json
{ "name": "My Project", "key": "MYP", "workflowId": "uuid"}List tasks
Section titled “List tasks”GET /api/projects/:projectId/tasksCreate task
Section titled “Create task”POST /api/projects/:projectId/tasksContent-Type: application/json
{ "title": "Add hello world endpoint", "typeId": "uuid", "statusId": "uuid"}Transition task
Section titled “Transition task”POST /api/tasks/:taskId/transitionContent-Type: application/json
{ "statusId": "target-status-uuid"}AI Jobs
Section titled “AI Jobs”Run an AI job manually
Section titled “Run an AI job manually”POST /api/tasks/:taskId/ai-jobsContent-Type: application/json
{ "templateId": "uuid"}Get job status
Section titled “Get job status”GET /api/ai-jobs/:jobIdStream job events (SSE)
Section titled “Stream job events (SSE)”GET /api/ai-jobs/:jobId/streamAccept: text/event-stream