Todoist API (REST v2 & API v1)
This skill provides direct API access to Todoist. Use this when the CLI is unavailable or failing.
Setup
Ensure
TODOIST_API_TOKEN is set or use the token from
~/.openclaw/.secrets/todoist_token.json.
Core Commands (REST v2)
List Active Tasks
curl -H "Authorization: Bearer $TODOIST_API_TOKEN" https://api.todoist.com/rest/v2/tasks | jq .
Note: If rest/v2 returns 410, use api/v1/tasks (see below).
Create Task
CODEBLOCK1
Close (Complete) Task
CODEBLOCK2
Fallback / Legacy Commands (API v1)
Use these if REST v2 endpoints return 410 Gone.
List Tasks (v1)
CODEBLOCK3
Create Task (v1)
CODEBLOCK4
Completed Tasks (v1)
CODEBLOCK5
Projects & Sections
List Projects
CODEBLOCK6
List Sections
CODEBLOCK7
Todoist API (REST v2 和 API v1)
本技能提供对 Todoist 的直接 API 访问。当 CLI 不可用或失败时使用。
设置
确保设置了 TODOIST
APITOKEN,或使用 ~/.openclaw/.secrets/todoist_token.json 中的令牌。
核心命令 (REST v2)
列出活跃任务
bash
curl -H Authorization: Bearer $TODOIST
APITOKEN https://api.todoist.com/rest/v2/tasks | jq .
注意:如果 rest/v2 返回 410,请使用 api/v1/tasks(见下文)。
创建任务
bash
curl -X POST -H Authorization: Bearer $TODOIST
APITOKEN \
-H Content-Type: application/json \
-d {content: 新任务, due_string: 今天} \
https://api.todoist.com/rest/v2/tasks
关闭(完成)任务
bash
curl -X POST -H Authorization: Bearer $TODOIST
APITOKEN https://api.todoist.com/rest/v2/tasks/
/close
备用/旧版命令 (API v1)
如果 REST v2 端点返回 410 Gone,请使用这些命令。
列出任务 (v1)
bash
curl -H Authorization: Bearer $TODOISTAPITOKEN https://api.todoist.com/api/v1/tasks | jq .results
创建任务 (v1)
bash
curl -X POST -H Authorization: Bearer $TODOISTAPITOKEN \
-H Content-Type: application/json \
-d {content: v1 任务, project_id: 6g382hF2W96x2hvr} \
https://api.todoist.com/api/v1/tasks
已完成任务 (v1)
bash
curl -H Authorization: Bearer $TODOISTAPITOKEN \
https://api.todoist.com/api/v1/tasks/completed/bycompletiondate?since=2026-03-01T00:00:00Z&until=2026-03-04T23:59:59Z | jq .items
项目和分区
列出项目
bash
curl -H Authorization: Bearer $TODOISTAPITOKEN https://api.todoist.com/rest/v2/projects
列出分区
bash
curl -H Authorization: Bearer $TODOISTAPITOKEN https://api.todoist.com/rest/v2/sections?projectid=id>