Todoist
Manage tasks, projects, and labels via Todoist REST API.
Setup
- Go to Settings → Integrations → Developer
- Copy your API token
- Set environment variable:
export TODOIST_API_TOKEN="your_token_here"
Tasks
List Active Tasks
curl -s "https://api.todoist.com/rest/v2/tasks" \
-H "Authorization: Bearer $TODOIST_API_TOKEN" | jq '.[] | {id, content, due: .due.date, priority, project_id}'
List Tasks in Project
curl -s "https://api.todoist.com/rest/v2/tasks?project_id=PROJECT_ID" \
-H "Authorization: Bearer $TODOIST_API_TOKEN" | jq
Get Task
curl -s "https://api.todoist.com/rest/v2/tasks/TASK_ID" \
-H "Authorization: Bearer $TODOIST_API_TOKEN" | jq
Create Task
curl -s -X POST "https://api.todoist.com/rest/v2/tasks" \
-H "Authorization: Bearer $TODOIST_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"content": "Buy groceries",
"due_string": "tomorrow at 10am",
"priority": 4
}' | jq
With project and labels:
curl -s -X POST "https://api.todoist.com/rest/v2/tasks" \
-H "Authorization: Bearer $TODOIST_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"content": "Review PR",
"project_id": "PROJECT_ID",
"labels": ["work", "urgent"],
"due_string": "today",
"priority": 3
}' | jq
Update Task
curl -s -X POST "https://api.todoist.com/rest/v2/tasks/TASK_ID" \
-H "Authorization: Bearer $TODOIST_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"content": "Updated task name", "priority": 2}' | jq
Complete Task
curl -s -X POST "https://api.todoist.com/rest/v2/tasks/TASK_ID/close" \
-H "Authorization: Bearer $TODOIST_API_TOKEN"
Reopen Task
curl -s -X POST "https://api.todoist.com/rest/v2/tasks/TASK_ID/reopen" \
-H "Authorization: Bearer $TODOIST_API_TOKEN"
Delete Task
curl -s -X DELETE "https://api.todoist.com/rest/v2/tasks/TASK_ID" \
-H "Authorization: Bearer $TODOIST_API_TOKEN"
Projects
List Projects
curl -s "https://api.todoist.com/rest/v2/projects" \
-H "Authorization: Bearer $TODOIST_API_TOKEN" | jq '.[] | {id, name, color}'
Create Project
curl -s -X POST "https://api.todoist.com/rest/v2/projects" \
-H "Authorization: Bearer $TODOIST_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "My Project", "color": "blue"}' | jq
Labels
List Labels
curl -s "https://api.todoist.com/rest/v2/labels" \
-H "Authorization: Bearer $TODOIST_API_TOKEN" | jq '.[] | {id, name, color}'
Create Label
curl -s -X POST "https://api.todoist.com/rest/v2/labels" \
-H "Authorization: Bearer $TODOIST_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "urgent", "color": "red"}' | jq
Due Dates
Todoist supports natural language for due_string:
today,tomorrow,next mondayevery day at 9amevery weekdayin 3 daysJan 15 at 2pm
Priority
1= Normal (no priority)2= Low (blue)3= Medium (orange)4= High (red/urgent)
Tips
- Task
contentsupports Markdown - Use labels for filtering and organization
due_stringis parsed naturally;due_datefor exact ISO dates- Rate limit: 450 requests per 15 minutes
