API生成
- 作者仓库星标 0
- 作者更新于 实时读取
- 作者仓库 skills-registry
- 领域
- 数据
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 读取环境变量
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: todoist-api
description: Manage Todoist tasks, projects, sections, labels, and comments via the REST API v2 using curl an…
category: 数据
runtime: 无特殊运行时
---
# todoist-api 输出预览
## PART A: 任务判断
- 适用问题:表格、CSV、数据集、指标或分析流程。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Authentication / Base URL / Confirmation Requirement”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于表格、CSV、数据集、指标或分析流程,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Authentication / Base URL / Confirmation Requirement”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、读取环境变量、会按任务需要访问外部网络、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文出现了 `/app`、`/tasks`、`/projects`、`/sections`、`/labels` 这类斜杠命令;如果你的 Agent 支持命令触发,优先用命令开场,再补充目标和边界。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令、读取环境变量。
先用一个小任务确认它会围绕“Authentication / Base URL / Confirmation Requirement”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: todoist-api
description: Manage Todoist tasks, projects, sections, labels, and comments via the REST API v2 using curl an…
category: 数据
source: tomevault-io/skills-registry
---
# todoist-api
## 什么时候使用
- 把数据处理方向的常用动作沉淀成 Agent 可调用的技能 适合处理表格、CSV、指标、数据集、分析和可视化报告,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步…
- 面向表格、CSV、数据集、指标或分析流程,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Authentication / Base URL / Confirmation Requirement」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "todoist-api" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Authentication / Base URL / Confirmation Requirement
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件、执行终端命令、读取环境变量 | 会按任务需要访问外部网络
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Todoist API Skill
Interact with the Todoist REST API v2 via curl and jq.
Authentication
Resolve the API token in order:
- Environment variable
TODOIST_API_TOKEN - User-provided token in conversation
- Ask the user (token is at: Todoist Settings → Integrations → Developer)
[ -n "$TODOIST_API_TOKEN" ] && echo "Token available" || echo "Token not set"
All requests use Bearer auth:
curl -s -H "Authorization: Bearer $TODOIST_API_TOKEN" \
"https://api.todoist.com/rest/v2/ENDPOINT"
POST requests add Content-Type:
curl -s -X POST \
-H "Authorization: Bearer $TODOIST_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"key": "value"}' \
"https://api.todoist.com/rest/v2/ENDPOINT"
Base URL
https://api.todoist.com/rest/v2/
Confirmation Requirement
Before executing any destructive action (DELETE, close, update, archive), ask the user for confirmation. A single confirmation covers a logical group of related actions.
Destructive: delete, close/complete, update, archive. Read-only (GET): no confirmation needed.
Priority Mapping
⚠️ The API and UI use inverted priority numbers:
| UI Label | API priority field |
Filter syntax |
|---|---|---|
| P1 (urgent, red) | 4 |
p1 |
| P2 (high, orange) | 3 |
p2 |
| P3 (medium, blue) | 2 |
p3 |
| P4 (normal, none) | 1 |
p4 |
When creating/updating tasks, use the API value (4 = urgent).
When using filter queries, use the UI label (p1 = urgent).
Task Links (v2 IDs)
⚠️ The REST API url field uses deprecated numeric IDs. Todoist deprecated /app/task/<numeric_id> URLs (end of 2025). The new format uses alphanumeric v2 IDs.
New URL format: https://app.todoist.com/app/task/<v2_id>
The REST API v2 does NOT return v2_id. Use the Sync API v9 to get it:
Get v2_id for a single task
curl -s -X POST \
-H "Authorization: Bearer $TODOIST_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"item_id": "TASK_ID"}' \
"https://api.todoist.com/sync/v9/items/get" | jq '.item.v2_id'
Works with both numeric IDs and v2_ids as input.
Get v2_ids for all tasks (bulk)
curl -s -X POST \
-H "Authorization: Bearer $TODOIST_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"sync_token": "*", "resource_types": ["items"]}' \
"https://api.todoist.com/sync/v9/sync" | jq '[.items[] | {id, v2_id, content}]'
Build a task link
# After getting v2_id from Sync API:
TASK_ID="9971910530"
V2_ID=$(curl -s -X POST \
-H "Authorization: Bearer $TODOIST_API_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"item_id\": \"$TASK_ID\"}" \
"https://api.todoist.com/sync/v9/items/get" | jq -r '.item.v2_id')
echo "https://app.todoist.com/app/task/$V2_ID"
Efficient bulk pattern (REST + Sync combo)
When listing multiple tasks, do ONE Sync call for the v2_id map instead of N individual lookups:
# 1. Get tasks via REST API (for filtering)
TASKS=$(curl -s -H "Authorization: Bearer $TODOIST_API_TOKEN" \
"https://api.todoist.com/rest/v2/tasks?filter=today")
# 2. Build v2_id lookup from Sync API (one call)
V2_MAP=$(curl -s -X POST \
-H "Authorization: Bearer $TODOIST_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"sync_token": "*", "resource_types": ["items"]}' \
"https://api.todoist.com/sync/v9/sync" | jq '[.items[] | {(.id): .v2_id}] | add')
# 3. Merge: replace URLs with v2 format
echo "$TASKS" | jq --argjson map "$V2_MAP" '
[.[] | . + {link: "https://app.todoist.com/app/task/\($map[.id])"}]
'
When presenting task links to the user, always use v2_id URLs. Never use the url field from the REST API directly.
Task Response Object
The REST API returns tasks with this structure:
{
"id": "123456789",
"content": "Task name",
"description": "Additional details",
"comment_count": 0,
"is_completed": false,
"order": 1,
"priority": 1,
"project_id": "987654321",
"section_id": null,
"parent_id": null,
"labels": [],
"creator_id": "111",
"created_at": "2024-01-15T10:30:00.000000Z",
"assignee_id": null,
"assigner_id": null,
"url": "https://app.todoist.com/app/task/123456789",
"duration": null,
"deadline": null,
"due": {
"date": "2024-01-20",
"string": "every monday",
"lang": "en",
"is_recurring": true
}
}
Note: The url field uses deprecated numeric IDs. See "Task Links (v2 IDs)" above for the correct URL format.
The due object
| Field | Type | Description |
|---|---|---|
date |
string | YYYY-MM-DD or RFC3339 datetime |
string |
string | Human-readable recurrence/date text |
lang |
string | Language code |
is_recurring |
boolean | Whether the task recurs |
due is null if no due date is set.
The deadline field
A hard deadline separate from due. When both are set, due is the soft/scheduled date and deadline is the hard cutoff. Can be set via deadline_date (YYYY-MM-DD) or deadline_datetime (RFC3339) when creating/updating tasks.
Endpoints Reference
Tasks
| Operation | Method | Endpoint |
|---|---|---|
| List active tasks | GET | /tasks |
| Get task | GET | /tasks/{id} |
| Create task | POST | /tasks |
| Update task | POST | /tasks/{id} |
| Close task | POST | /tasks/{id}/close |
| Reopen task | POST | /tasks/{id}/reopen |
| Delete task | DELETE | /tasks/{id} |
Task filters (query params for GET /tasks):
project_id— filter by projectsection_id— filter by sectionlabel— filter by label namefilter— Todoist filter query (e.g.today,overdue). Seereferences/filters.md
Task creation/update fields:
content(required for creation) — task textdescription— additional detailsproject_id,section_id,parent_id— organizationpriority— 1 (normal) to 4 (urgent). See Priority Mapping abovedue_string— natural language ("tomorrow", "every monday")due_date— YYYY-MM-DDdue_datetime— RFC3339deadline_date— YYYY-MM-DD hard deadlinedeadline_datetime— RFC3339 hard deadlinelabels— array of label namesassignee_id— for shared projectsduration,duration_unit— estimated time
Projects
| Operation | Method | Endpoint |
|---|---|---|
| List projects | GET | /projects |
| Get project | GET | /projects/{id} |
| Create project | POST | /projects |
| Update project | POST | /projects/{id} |
| Archive project | POST | /projects/{id}/archive |
| Unarchive project | POST | /projects/{id}/unarchive |
| Delete project | DELETE | /projects/{id} |
| List collaborators | GET | /projects/{id}/collaborators |
Project fields: name (required), parent_id, color (e.g. "berry_red", "blue"), is_favorite, view_style ("list" or "board")
Sections
| Operation | Method | Endpoint |
|---|---|---|
| List sections | GET | /sections |
| Get section | GET | /sections/{id} |
| Create section | POST | /sections |
| Update section | POST | /sections/{id} |
| Delete section | DELETE | /sections/{id} |
Section fields: name (required), project_id (required for creation), order
Labels
| Operation | Method | Endpoint |
|---|---|---|
| List personal labels | GET | /labels |
| Get label | GET | /labels/{id} |
| Create label | POST | /labels |
| Update label | POST | /labels/{id} |
| Delete label | DELETE | /labels/{id} |
Label fields: name (required), color, order, is_favorite
Comments
| Operation | Method | Endpoint |
|---|---|---|
| List comments | GET | /comments |
| Get comment | GET | /comments/{id} |
| Create comment | POST | /comments |
| Update comment | POST | /comments/{id} |
| Delete comment | DELETE | /comments/{id} |
Comment query params: task_id or project_id (one required for listing)
Comment fields: content (required, markdown supported), task_id or project_id (one required for creation)
Pagination
Most REST v2 endpoints (tasks, projects, sections, labels) return flat JSON arrays — no pagination needed.
Pagination with cursors applies only to specific endpoints like completed tasks (API v1). See references/completed-tasks.md for the cursor-based pagination pattern.
Common Patterns
Create a task with due date
curl -s -X POST \
-H "Authorization: Bearer $TODOIST_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"content": "Buy milk", "due_string": "tomorrow", "priority": 4}' \
"https://api.todoist.com/rest/v2/tasks"
Note: priority: 4 = urgent (P1 in UI).
Get today's tasks
curl -s -H "Authorization: Bearer $TODOIST_API_TOKEN" \
"https://api.todoist.com/rest/v2/tasks?filter=today" | jq '.'
Get overdue tasks
curl -s -H "Authorization: Bearer $TODOIST_API_TOKEN" \
"https://api.todoist.com/rest/v2/tasks?filter=overdue" | jq '.'
Complete a task
curl -s -X POST \
-H "Authorization: Bearer $TODOIST_API_TOKEN" \
"https://api.todoist.com/rest/v2/tasks/TASK_ID/close"
List all tasks in a project
curl -s -H "Authorization: Bearer $TODOIST_API_TOKEN" \
"https://api.todoist.com/rest/v2/tasks?project_id=PROJECT_ID" | jq '.'
Error Handling
| Code | Meaning |
|---|---|
| 200 | Success with body |
| 204 | Success, no content |
| 400 | Bad request |
| 401 | Auth failed |
| 403 | Forbidden |
| 404 | Not found |
| 429 | Rate limited (wait + retry) |
| 5xx | Server error (safe to retry) |
response=$(curl -s -w "\n%{http_code}" \
-H "Authorization: Bearer $TODOIST_API_TOKEN" \
"https://api.todoist.com/rest/v2/tasks")
http_code=$(echo "$response" | tail -1)
body=$(echo "$response" | sed '$d')
if [ "$http_code" -ge 200 ] && [ "$http_code" -lt 300 ]; then
echo "$body" | jq '.'
else
echo "Error: HTTP $http_code"
echo "$body"
fi
Idempotency
For safe retries on writes, include X-Request-Id (max 36 chars):
curl -s -X POST \
-H "Authorization: Bearer $TODOIST_API_TOKEN" \
-H "Content-Type: application/json" \
-H "X-Request-Id: $(uuidgen)" \
-d '{"content": "New task"}' \
"https://api.todoist.com/rest/v2/tasks"
Completed Tasks
REST v2 /tasks returns only active tasks. For completed task history, see references/completed-tasks.md.
Additional Reference
references/completed-tasks.md— completed task history (API v1 endpoints, cursor pagination)references/filters.md— Todoist filter query syntax
Source: aneym/agent-skills — distributed by TomeVault.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核