Todo API Documentation

Endpoints

GET /api/tasks

Get all tasks with computed fields (completed, isOverdue, daysOverdue)

curl https://api.crv.sh/api/tasks

GET /api/tasks/{id}

Get a specific task by ID

curl https://api.crv.sh/api/tasks/1

PUT /api/tasks/{id}/subtasks/{subId}/toggle

Toggle completion status of a subtask

curl -X PUT https://api.crv.sh/api/tasks/1/subtasks/1/toggle

GET /api/users

Get all users

curl https://api.crv.sh/api/users

GET /api/users/{email}/tasks

Get all tasks assigned to a user by their email

curl https://api.crv.sh/api/users/alice@example.com/tasks

GET /health

Health check endpoint

curl https://api.crv.sh/health

POST /api/admin/users

Create a new user (Admin only)

Requires: Admin SSH public key authentication

Request Body:

{
  "id": "optional-user-id",
  "name": "Full Name",
  "email": "user@example.com",
  "publicKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQAB...",
  "isAdmin": false
}

Example:

curl -X POST -H "Content-Type: application/json" \
     -H "X-SSH-Public-Key: $(cat ~/.ssh/id_rsa.pub)" \
     -H "X-SSH-Signature: $SIGNATURE" \
     -H "X-SSH-Nonce: $NONCE" \
     -d '{"name":"John Doe","email":"john@example.com","publicKey":"ssh-rsa AAAAB3...","isAdmin":false}' \
     %!s(MISSING)/api/admin/users

Features