Caution
box-python-sdk-gen is deprecated and no longer maintained. As of September 17, 2025, it receives no new features, bug fixes, or security patches. Do not use it for new projects.
Use box-python-sdk v10+ instead: pip install "boxsdk>=10".
The equivalent of this page is box-python-sdk/docs/tasks.md. To migrate existing code, see the migration guide.
Retrieves a list of all the tasks for a file. This endpoint does not support pagination.
This operation is performed by calling function get_file_tasks.
See the endpoint docs at API Reference.
client.tasks.get_file_tasks(file.id)- file_id
str- The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL
https://*.app.box.com/files/123thefile_idis123. Example: "12345"
- The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL
- extra_headers
Optional[Dict[str, Optional[str]]]- Extra headers that will be included in the HTTP request.
This function returns a value of type Tasks.
Returns a list of tasks on a file.
If there are no tasks on this file an empty collection is returned instead.
Creates a single task on a file. This task is not assigned to any user and will need to be assigned separately.
This operation is performed by calling function create_task.
See the endpoint docs at API Reference.
client.tasks.create_task(
CreateTaskItem(type=CreateTaskItemTypeField.FILE, id=file.id),
action=CreateTaskAction.REVIEW,
message="test message",
due_at=date_time,
completion_rule=CreateTaskCompletionRule.ALL_ASSIGNEES,
)- item
CreateTaskItem- The file to attach the task to.
- action
Optional[CreateTaskAction]- The action the task assignee will be prompted to do. Must be _
reviewdefines an approval task that can be approved or, rejected _completedefines a general task which can be completed.
- The action the task assignee will be prompted to do. Must be _
- message
Optional[str]- An optional message to include with the task.
- due_at
Optional[DateTime]- Defines when the task is due. Defaults to
nullif not provided.
- Defines when the task is due. Defaults to
- completion_rule
Optional[CreateTaskCompletionRule]- Defines which assignees need to complete this task before the task is considered completed. _
all_assignees(default) requires all assignees to review or approve the the task in order for it to be considered completed. _any_assigneeaccepts any one assignee to review or approve the the task in order for it to be considered completed.
- Defines which assignees need to complete this task before the task is considered completed. _
- extra_headers
Optional[Dict[str, Optional[str]]]- Extra headers that will be included in the HTTP request.
This function returns a value of type Task.
Returns the newly created task.
Retrieves information about a specific task.
This operation is performed by calling function get_task_by_id.
See the endpoint docs at API Reference.
client.tasks.get_task_by_id(task.id)- task_id
str- The ID of the task. Example: "12345"
- extra_headers
Optional[Dict[str, Optional[str]]]- Extra headers that will be included in the HTTP request.
This function returns a value of type Task.
Returns a task object.
Updates a task. This can be used to update a task's configuration, or to update its completion state.
This operation is performed by calling function update_task_by_id.
See the endpoint docs at API Reference.
client.tasks.update_task_by_id(task.id, message="updated message")- task_id
str- The ID of the task. Example: "12345"
- action
Optional[UpdateTaskByIdAction]- The action the task assignee will be prompted to do. Must be _
reviewdefines an approval task that can be approved or rejected, _completedefines a general task which can be completed.
- The action the task assignee will be prompted to do. Must be _
- message
Optional[str]- The message included with the task.
- due_at
Optional[DateTime]- When the task is due at.
- completion_rule
Optional[UpdateTaskByIdCompletionRule]- Defines which assignees need to complete this task before the task is considered completed. _
all_assignees(default) requires all assignees to review or approve the the task in order for it to be considered completed. _any_assigneeaccepts any one assignee to review or approve the the task in order for it to be considered completed.
- Defines which assignees need to complete this task before the task is considered completed. _
- extra_headers
Optional[Dict[str, Optional[str]]]- Extra headers that will be included in the HTTP request.
This function returns a value of type Task.
Returns the updated task object.
Removes a task from a file.
This operation is performed by calling function delete_task_by_id.
See the endpoint docs at API Reference.
client.tasks.delete_task_by_id(task.id)- task_id
str- The ID of the task. Example: "12345"
- extra_headers
Optional[Dict[str, Optional[str]]]- Extra headers that will be included in the HTTP request.
This function returns a value of type None.
Returns an empty response when the task was successfully deleted.