REST API
REST API
The REST API is available when klt serve is running. All endpoints are prefixed with /api/v1.
Base URL: http://localhost:7842/api/v1
Authentication
If Basic Auth is enabled (users with passwords exist), all API requests require credentials:
curl -u username:password http://localhost:7842/api/v1/projectsWhen no users are configured, the API is open access.
Projects
List projects
curl http://localhost:7842/api/v1/projectsResponse:
[
{
"id": 1,
"slug": "kleidi-task",
"name": "kleidi-task",
"path": "/root/projects/kleidi-task",
"cached_todo_count": 3,
"cached_doing_count": 1,
"cached_total_count": 42
}
]Get project
curl http://localhost:7842/api/v1/projects/kleidi-taskGet project stats
curl http://localhost:7842/api/v1/projects/kleidi-task/statsResponse:
{
"todo": 3,
"doing": 1,
"done": 38,
"bugs_open": 0
}Tasks
List tasks
curl http://localhost:7842/api/v1/projects/kleidi-task/tasksQuery parameters:
| Parameter | Description | Example |
|---|---|---|
status | Filter by status | todo, doing, done |
type | Filter by type | task, bug, feature |
limit | Max results (default 50) | 100 |
offset | Pagination offset | 50 |
min_priority | Minimum priority | 3 |
created_after | ISO 8601 date | 2026-04-01 |
created_before | ISO 8601 date | 2026-04-30 |
Example with filters:
curl "http://localhost:7842/api/v1/projects/kleidi-task/tasks?status=todo&type=bug&limit=10"Response:
{
"tasks": [
{
"id": 42,
"type": "bug",
"title": "Login fails on Firefox",
"description": "Steps to reproduce...",
"status": "todo",
"priority": 5,
"category": "frontend",
"phase": "",
"is_archived": false,
"source": "mcp",
"created_at": "2026-04-28T10:00:00Z",
"updated_at": "2026-04-28T10:00:00Z",
"created_by": 1
}
],
"total": 1,
"limit": 10,
"offset": 0,
"total_pages": 1,
"page": 1
}Create task
curl -X POST http://localhost:7842/api/v1/projects/kleidi-task/tasks \
-H "Content-Type: application/json" \
-d '{"title": "Fix login bug", "type": "bug", "priority": 5}'Get task
curl http://localhost:7842/api/v1/projects/kleidi-task/tasks/42Update task
curl -X PATCH http://localhost:7842/api/v1/projects/kleidi-task/tasks/42 \
-H "Content-Type: application/json" \
-d '{"status": "doing", "priority": 8}'All fields are optional — only provided fields are updated.
Delete task
curl -X DELETE http://localhost:7842/api/v1/projects/kleidi-task/tasks/42Complete task
curl -X POST http://localhost:7842/api/v1/projects/kleidi-task/tasks/42/completeArchive / Unarchive task
curl -X POST http://localhost:7842/api/v1/projects/kleidi-task/tasks/42/archive
curl -X POST http://localhost:7842/api/v1/projects/kleidi-task/tasks/42/unarchiveSystem
Health check
curl http://localhost:7842/api/v1/healthVersion
curl http://localhost:7842/api/v1/version