360 Secure SkillHub
360 安全技能中心

Todoist Api Rest

通过 curl 配合 jq 直接调用 Todoist REST v2 与 API v1 接口:列出活动任务、创建任务、完成任务,以及列出项目和分区;文档提示 REST v2 返回 410 时可改用 API v1 端点,并需先设置 Todoist API 令牌。

nitsujy
nitsujy
热度 86.06
最近更新 2026-05-11 17:28:27
分类:自动化依赖:代码执行 / 第三方 API应用场景:任务管理 / API 集成 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add todoist-api-rest
Metadata
name
todoist-api-rest
description
Direct Todoist API integration via curl/jq. Lightweight, reliable, and uses working v1/v2 endpoints.
homepage
https://developer.todoist.com
metadata
{"clawdbot":{"emoji":"✅","requires":{"bins":["curl","jq"],"env":["TODOIST_API_TOKEN"]}}}

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

curl -X POST -H "Authorization: Bearer $TODOIST_API_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"content": "New Task", "due_string": "today"}' \
     https://api.todoist.com/rest/v2/tasks

Close (Complete) Task

curl -X POST -H "Authorization: Bearer $TODOIST_API_TOKEN" https://api.todoist.com/rest/v2/tasks/<task_id>/close

Fallback / Legacy Commands (API v1)

Use these if REST v2 endpoints return 410 Gone.

List Tasks (v1)

curl -H "Authorization: Bearer $TODOIST_API_TOKEN" https://api.todoist.com/api/v1/tasks | jq .results

Create Task (v1)

curl -X POST -H "Authorization: Bearer $TODOIST_API_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"content": "v1 Task", "project_id": "6g382hF2W96x2hvr"}' \
     https://api.todoist.com/api/v1/tasks

Completed Tasks (v1)

curl -H "Authorization: Bearer $TODOIST_API_TOKEN" \
     "https://api.todoist.com/api/v1/tasks/completed/by_completion_date?since=2026-03-01T00:00:00Z&until=2026-03-04T23:59:59Z" | jq .items

Projects & Sections

List Projects

curl -H "Authorization: Bearer $TODOIST_API_TOKEN" https://api.todoist.com/rest/v2/projects

List Sections

curl -H "Authorization: Bearer $TODOIST_API_TOKEN" "https://api.todoist.com/rest/v2/sections?project_id=<project_id>"