Examples
Task Operations
Create a task
bash
# Quick add (AI enrichment)
curl -X POST https://tasks.example.com/api/tasks \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"title": "buy groceries tomorrow afternoon"}'
# Structured (skip AI)
curl -X POST https://tasks.example.com/api/tasks \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"title": "Buy groceries", "due_at": "2026-03-02T17:00:00Z", "priority": 1}'List tasks
bash
# All active tasks
curl https://tasks.example.com/api/tasks \
-H "Authorization: Bearer $TOKEN"
# Filter by project
curl "https://tasks.example.com/api/tasks?project_id=1" \
-H "Authorization: Bearer $TOKEN"
# Search
curl "https://tasks.example.com/api/tasks?search=dentist" \
-H "Authorization: Bearer $TOKEN"
# Overdue tasks only
curl "https://tasks.example.com/api/tasks?overdue=true" \
-H "Authorization: Bearer $TOKEN"Update a task
bash
curl -X PATCH https://tasks.example.com/api/tasks/42 \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"priority": 3, "labels": ["urgent", "work"]}'Snooze a task
bash
curl -X POST https://tasks.example.com/api/tasks/42/snooze \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"until": "2026-03-02T14:00:00Z"}'Mark done
bash
curl -X POST https://tasks.example.com/api/tasks/42/done \
-H "Authorization: Bearer $TOKEN"Bulk Operations
Bulk snooze all overdue
bash
# Snooze all overdue P0-P3 tasks (uses user's default duration)
curl -X POST https://tasks.example.com/api/tasks/bulk/snooze-overdue \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
# Snooze to a specific time
curl -X POST https://tasks.example.com/api/tasks/bulk/snooze-overdue \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"until": "2026-03-02T17:00:00Z"}'Bulk mark done
bash
curl -X POST https://tasks.example.com/api/tasks/bulk/done \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"ids": [1, 2, 3]}'Undo
bash
# Undo last action
curl -X POST https://tasks.example.com/api/undo \
-H "Authorization: Bearer $TOKEN"
# Redo
curl -X POST https://tasks.example.com/api/redo \
-H "Authorization: Bearer $TOKEN"Data Export
bash
# Full JSON export
curl https://tasks.example.com/api/export?format=json \
-H "Authorization: Bearer $TOKEN" > backup.json
# CSV export (tasks)
curl "https://tasks.example.com/api/export?format=csv&type=tasks" \
-H "Authorization: Bearer $TOKEN" > tasks.csv