From 40c4337de1abff1b94252c067d51699952ba1c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Silva?= Date: Fri, 20 Feb 2026 02:42:42 +0000 Subject: [PATCH] Add order support to task updates Allow update_task in sync and async clients to accept order and send it in the request payload. Also extend task update tests to validate that order is passed through. --- tests/test_api_tasks.py | 1 + todoist_api_python/api.py | 3 +++ todoist_api_python/api_async.py | 3 +++ 3 files changed, 7 insertions(+) diff --git a/tests/test_api_tasks.py b/tests/test_api_tasks.py index 2787a37..dd24489 100644 --- a/tests/test_api_tasks.py +++ b/tests/test_api_tasks.py @@ -359,6 +359,7 @@ async def test_update_task( "description": "Updated description", "labels": ["label1", "label2"], "priority": 2, + "order": 3, } updated_task_dict = default_task.to_dict() | args diff --git a/todoist_api_python/api.py b/todoist_api_python/api.py index a5d2fc1..269595f 100644 --- a/todoist_api_python/api.py +++ b/todoist_api_python/api.py @@ -356,6 +356,7 @@ def update_task( due_date: date | None = None, due_datetime: datetime | None = None, assignee_id: str | None = None, + order: int | None = None, day_order: int | None = None, collapsed: bool | None = None, duration: Annotated[int, Ge(1)] | None = None, @@ -378,6 +379,7 @@ def update_task( :param due_date: The due date as a date object. :param due_datetime: The due date and time as a datetime object. :param assignee_id: User ID to whom the task is assigned. + :param order: The order of task in the project or section. :param day_order: The order of the task inside Today or Next 7 days view. :param collapsed: Whether the task's sub-tasks are collapsed. :param duration: The amount of time the task will take. @@ -401,6 +403,7 @@ def update_task( format_datetime(due_datetime) if due_datetime is not None else None ), assignee_id=assignee_id, + order=order, day_order=day_order, collapsed=collapsed, duration=duration, diff --git a/todoist_api_python/api_async.py b/todoist_api_python/api_async.py index f053863..4482ce3 100644 --- a/todoist_api_python/api_async.py +++ b/todoist_api_python/api_async.py @@ -376,6 +376,7 @@ async def update_task( due_date: date | None = None, due_datetime: datetime | None = None, assignee_id: str | None = None, + order: int | None = None, day_order: int | None = None, collapsed: bool | None = None, duration: Annotated[int, Ge(1)] | None = None, @@ -398,6 +399,7 @@ async def update_task( :param due_date: The due date as a date object. :param due_datetime: The due date and time as a datetime object. :param assignee_id: User ID to whom the task is assigned. + :param order: The order of task in the project or section. :param day_order: The order of the task inside Today or Next 7 days view. :param collapsed: Whether the task's sub-tasks are collapsed. :param duration: The amount of time the task will take. @@ -421,6 +423,7 @@ async def update_task( format_datetime(due_datetime) if due_datetime is not None else None ), assignee_id=assignee_id, + order=order, day_order=day_order, collapsed=collapsed, duration=duration,