Skip to main content

Update Task

Endpoint

URL: /api/v6.1/task Method: PUT

Request Headers

Content-Type: application/json
X-API-KEY: <your_api_key>

Request Body

| Field | Data Type | Description |
|--------|-------------|--------|
| current_task_code | string | The current task code to update. |
| task_code | string | New task code (if changed). |
| task_name | string | Task name. |
| task_start_date | string | Task start date and time (format YYYY-MM-DD HH:MM:SS). |
| task_end_date | string | Task end date and time (format YYYY-MM-DD HH:MM:SS). |
| project_name | string | Related project name. |
| task_parent_code | string | Parent task code (if any). |
| task_type_name | string | Task type. |
| task_weight | integer | Task priority level. |
| task_description | string | Task content description (supports HTML). |
| task_receiver_username | string | Name of the person assigned the task. |
| related_users | array | List of related users. |
| task_color | string | Task color. |
| custom_fields | object | Custom fields containing additional information. |
| task_accounts | array | List of accounts related to the task. |\

{
"current_task_code": "Task.0003",
"task_code": "Task.0003[UP]",
"task_name": "[L5] API form task [UPDATE]",
"task_start_date": "2025-03-14 19:00:00",
"task_end_date": "2025-03-14 21:00:00",
"project_name": "API Project",
"task_parent_code": "Task.0001",
"task_type_name": "Skin brightening",
"task_weight": 96,
"task_description": "<p>Task content</p>",
"task_receiver_username": "nguoilinh",
"related_users": [
"nguoilinh",
"sangkhanh",
"trandinhcuong"
],
"task_color": "#06aed4",
"custom_fields": {
"flight_date": "2025-03-18",
"flight_code": "SGN.912812",
"technician": "Technician A"
},
"task_accounts": [
{
"account_code": "KH-VUIN",
"account_phone": "0988977888",
"contact_name": "Customer B",
"account_name": "ABC Company"
}
]
}

Request Example

curl --location --request PUT 'https://xxxx.getflycrm.com/api/v6.1/task' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <your_api_key>' \
--data '{
"current_task_code": "Task.0003",
"task_code": "Task.0003[UP]",
"task_name": "[L5] API form task [UPDATE]",
"task_start_date": "2025-03-14 19:00:00",
"task_end_date": "2025-03-14 21:00:00",
"project_name": "API Project",
"task_parent_code": "Task.0001",
"task_type_name": "Skin brightening",
"task_weight": 96,
"task_description": "<p>Task content</p>",
"task_receiver_username": "nguoilinh",
"related_users": [
"nguoilinh",
"sangkhanh",
"trandinhcuong"
],
"task_color": "#06aed4",
"custom_fields": {
"flight_date": "2025-03-18",
"flight_code": "SGN.912812",
"technician": "Technician A"
},
"task_accounts": [
{
"account_code": "KH-VUIN",
"account_phone": "0988977888",
"contact_name": "Customer B",
"account_name": "ABC Company"
}
]
}'

Response

{
"message": "Successfully updated",
"data": {
"task_id": 98,
"task_code": "Task.0003[UP]"
}
}

Description of Fields in Response

| Field | Data Type | Description |
|--------|-------------|--------|
| message | string | API status message. |
| data.task_id | integer | ID of the updated task. |
| data.task_code | string | Code of the task after update. |\

Notes

  • This API is used to update task information based on current_task_code.
  • If successful, the API returns the message "Successfully updated" along with the task_id and task_code of the updated task.