# Todoist REST API V2 Cheat Sheet Quick reference for the [Todoist REST API v2](https://developer.todoist.com/rest/v2/) based on the official documentation. ## Authentication All requests must include an `Authorization` header with the API token: ``` Authorization: Bearer YOUR_API_TOKEN ``` Your Todoist API token is securely stored in the `~/.todoist_token` file. ## Rate Limits - 1000 requests per 15 minutes per user - 1 MB max HTTP request body on POST - 65 KB max total HTTP header size - 15 second timeout per request ## Tasks ### List Active Tasks - `GET /tasks` - Query parameters: - `project_id` *(optional)*: Filter by project - `label_id` *(optional)*: Filter by label - `filter` *(optional)*: Filter by various criteria ### Create Task - `POST /tasks` - Request body: - `content` *(required)*: Task content - `description` *(optional)*: Task description/notes - `project_id` *(optional)*: Project to add task to - `section_id` *(optional)*: Section to add task to - `parent_id` *(optional)*: Parent task ID - `order` *(optional)*: Task order - `labels` *(optional)*: Array of label names - `priority` *(optional)*: Task priority from 1 (normal) to 4 (urgent) - `due_string` *(optional)*: Human-readable due date - `due_date` *(optional)*: Specific due date in `YYYY-MM-DD` format - `due_datetime` *(optional)*: Specific due date and time in RFC3339 format - `assignee_id` *(optional)*: User ID to assign task to ### Get Active Task - `GET /tasks/{task_id}` ### Update Task - `POST /tasks/{task_id}` - Request body: Same fields as create task ### Close Task - `POST /tasks/{task_id}/close` ### Reopen Task - `POST /tasks/{task_id}/reopen` ### Delete Task - `DELETE /tasks/{task_id}` ## Projects ### List Projects - `GET /projects` ### Create Project - `POST /projects` - Request body: - `name` *(required)*: Project name - `parent_id` *(optional)*: Parent project ID - `color` *(optional)*: Color name - `is_favorite` *(optional)*: Set as favorite project ### Get Project - `GET /projects/{project_id}` ### Update Project - `POST /projects/{project_id}` - Request body: Same fields as create project ### Delete Project - `DELETE /projects/{project_id}` ## Projects (continued) ### Project Colors Colors are now specified as string names instead of numeric IDs. Common values: - `berry_red` - `red` - `orange` - `yellow` - `olive_green` - `lime_green` - `green` - `mint_green` - `teal` - `sky_blue` - `light_blue` - `blue` - `grape` - `violet` - `lavender` - `magenta` - `salmon` - `charcoal` - `grey` - `taupe` ### Project View Styles - `list`: Display project as a list view - `board`: Display project as a board view ## Labels ### List Labels - `GET /labels` ### Create Label - `POST /labels` - Request body: - `name` *(required)*: Label name - `color` *(optional)*: Color name - `is_favorite` *(optional)*: Set as favorite label ### Get Label - `GET /labels/{label_id}` ### Update Label - `POST /labels/{label_id}` - Request body: Same fields as create label ### Delete Label - `DELETE /labels/{label_id}` ## Comments ### List Comments - `GET /comments` - Query parameters: - `task_id` *(optional)*: Filter by task - `project_id` *(optional)*: Filter by project ### Create Comment - `POST /comments` - Request body: - `task_id` or `project_id` *(required)*: Associated task or project - `content` *(required)*: Comment text - `attachment` *(optional)*: File attachment object ### Get Comment - `GET /comments/{comment_id}` ### Update Comment - `POST /comments/{comment_id}` - Request body: - `content` *(required)*: Updated comment text ### Delete Comment - `DELETE /comments/{comment_id}` ## Additional Resources - [Official API Documentation](https://developer.todoist.com/rest/v2/) - [Python SDK](https://github.com/Doist/todoist-python) - [JavaScript SDK](https://github.com/Doist/todoist-api-typescript)