# Todo API Skill

Use this deployment-aware API to let an AI Agent manage the shared Todo list.
The same contract is available from the Cloudflare Worker and the Docker Go
server. This document is generated by the current host.

## Connection

- Base URL: https://todo.43.154.130.214.sslip.io/api/v1
- AI credential: set EVA_TODO_ADMIN_TOKEN
- Device credential: set EVA_TODO_DEVICE_TOKEN

Send the selected credential as Authorization: Bearer <token>.
Never invent a URL or token, print a token, commit a token, or ask the user to
paste a token into a public prompt.

## Permissions

- ADMIN_TOKEN: list, search, create, edit, complete, reopen, soft-delete tasks,
  and read device reports. This is the credential for an AI Agent that manages
  the task list.
- DEVICE_TOKEN: device /sync, /events, and /report access. It cannot perform
  admin task writes or read the admin-only report list.

## Agent workflow

1. Call GET /health, then GET /tasks before changing anything.
2. Use the admin token for task management and report reads.
3. Keep badge-visible titles short; put Chinese details, URLs, and long
   instructions in notes.
4. After every write, call GET /tasks or GET /tasks/{id} and report the task id
   and resulting status.
5. Ask for confirmation when a delete request is ambiguous. DELETE is a soft
   delete, but deleted records are purged after 24 hours.

## Common calls

GET /health
GET /tasks?status=todo&q=server&tag=ops
GET /tasks/{id}
POST /tasks with JSON {"title":"SHORT TITLE","notes":"中文详情","priority":1,"urgent":false}
PATCH /tasks/{id}
POST /tasks/{id}/complete
POST /tasks/{id}/reopen
DELETE /tasks/{id}
GET /reports?limit=20

The local helper is available at skills/eva-todo-control/scripts/eva_todo.mjs.
