Skip to content

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/projects

When no users are configured, the API is open access.

Projects

List projects

curl http://localhost:7842/api/v1/projects

Response:

[
  {
    "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-task

Get project stats

curl http://localhost:7842/api/v1/projects/kleidi-task/stats

Response:

{
  "todo": 3,
  "doing": 1,
  "done": 38,
  "bugs_open": 0
}

Tasks

List tasks

curl http://localhost:7842/api/v1/projects/kleidi-task/tasks

Query parameters:

ParameterDescriptionExample
statusFilter by statustodo, doing, done
typeFilter by typetask, bug, feature
limitMax results (default 50)100
offsetPagination offset50
min_priorityMinimum priority3
created_afterISO 8601 date2026-04-01
created_beforeISO 8601 date2026-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/42

Update 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/42

Complete task

curl -X POST http://localhost:7842/api/v1/projects/kleidi-task/tasks/42/complete

Archive / 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/unarchive

System

Health check

curl http://localhost:7842/api/v1/health

Version

curl http://localhost:7842/api/v1/version