Update the fields of a task. Send only the fields to change. You cannot change id, created_at, updated_at and project_id. Dates use the ISO 8601 format. You must be an administrator or a manager of the project. A supervisor of the project can change only priority, start_date, due_date, estimation, difficulty and data. A supervisor must send only these fields. Any other field in the body, including id and project_id, gives 403. The task type must also be in the departments of the supervisor, if they have departments. The data field merges into the current metadata. A bot made for previews cannot be an assignee. A change of assignees sends task:assign and task:unassign events and notifies the new assignees.
PUT
/data/tasks/{instance_id}
curl
curl -X PUT "http://api.example.com/data/tasks/a24a6ea4-ce75-4665-a070-57453082c25" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"task_status_id": "b24a6ea4-ce75-4665-a070-57453082c25",
"assignees": [
"c24a6ea4-ce75-4665-a070-57453082c25"
],
"duration": 8.5
}'
import requests
url = "http://api.example.com/data/tasks/a24a6ea4-ce75-4665-a070-57453082c25"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json"
}
params = {}
payload = {
"task_status_id": "b24a6ea4-ce75-4665-a070-57453082c25",
"assignees": [
"c24a6ea4-ce75-4665-a070-57453082c25"
],
"duration": 8.5
}
response = requests.put(
url,
headers=headers,
params=params,
json=payload
)
response.raise_for_status()
if response.content:
print(response.json())
Request examples
{
"task_status_id": "b24a6ea4-ce75-4665-a070-57453082c250",
"assignees": [
"c24a6ea4-ce75-4665-a070-57453082c250"
],
"duration": 8.5
}
Response examples (200)
{
"id": "a24a6ea4-ce75-4665-a070-57453082c250",
"task_type_id": "b24a6ea4-ce75-4665-a070-57453082c250",
"entity_id": "c24a6ea4-ce75-4665-a070-57453082c250",
"project_id": "d24a6ea4-ce75-4665-a070-57453082c250",
"task_status_id": "e24a6ea4-ce75-4665-a070-57453082c250",
"assignees": [
"f24a6ea4-ce75-4665-a070-57453082c250"
],
"duration": 8.5,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T11:00:00Z"
}