| name | todoist-api-5-comments-management |
| description | Sub-skill of todoist-api: 5. Comments Management (+1). |
| version | 1.0.0 |
| category | business |
| type | reference |
| scripts_exempt | true |
5. Comments Management (+1)
5. Comments Management
REST API - Comments:
curl -s -X GET "https://api.todoist.com/rest/v2/comments?task_id=TASK_ID" \
-H "Authorization: Bearer $TODOIST_API_KEY" | jq
curl -s -X GET "https://api.todoist.com/rest/v2/comments?project_id=PROJECT_ID" \
-H "Authorization: Bearer $TODOIST_API_KEY" | jq
curl -s -X POST "https://api.todoist.com/rest/v2/comments" \
-H "Authorization: Bearer $TODOIST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"task_id": "TASK_ID",
"content": "This is a comment on the task"
}' | jq
curl -s -X POST "https://api.todoist.com/rest/v2/comments" \
-H "Authorization: Bearer $TODOIST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"task_id": "TASK_ID",
"content": "See attached file",
"attachment": {
"file_name": "report.pdf",
"file_type": "application/pdf",
"file_url": "https://example.com/report.pdf"
}
}' | jq
curl -s -X POST "https://api.todoist.com/rest/v2/comments/COMMENT_ID" \
-H "Authorization: Bearer $TODOIST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Updated comment content"
}' | jq
curl -s -X DELETE "https://api.todoist.com/rest/v2/comments/COMMENT_ID" \
-H "Authorization: Bearer $TODOIST_API_KEY"
Python SDK - Comments:
comments = api.get_comments(task_id="1234567890")
for comment in comments:
print(f" {comment.posted_at}: {comment.content}")
new_comment = api.add_comment(
task_id="1234567890",
content="Added some notes about this task"
)
api.update_comment(
comment_id=new_comment.id,
content="Updated notes"
)
api.delete_comment(comment_id=new_comment.id)
6. Filters and Queries
Filter Syntax:
"today"
"tomorrow"
"overdue"
"next 7 days"
"no date"
"Jan 15"
"before: Jan 20"
"after: Jan 10"
"p1"
"p2"
"p3"
"p4"
"(p1 | p2)"
"@work"
"@work & @urgent"
"@work | @personal"
"!@work"
"#Work"
"##Work"
"#Work & #Q1"
Python Filter Examples:
today_work = api.get_tasks(filter="today & @work")
urgent = api.get_tasks(filter="(p1 | p2) & (today | overdue)")
project_pending = api.get_tasks(filter="#ProjectAlpha & !@completed")
this_week = api.get_tasks(filter="next 7 days")
no_date = api.get_tasks(filter="no date & @inbox")
complex_filter = api.get_tasks(
filter="(today | tomorrow) & (p1 | p2) & (#Work | #Personal) & !@waiting"
)