Add New Task
Endpoint
URL: /api/v6.1/task
Method: POST
Request Headers
Content-Type: application/json
X-API-KEY: <your_api_key>
Request Body
| Field | Data Type | Description |
|--------|-------------|--------|
| 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_code
| string | string | Unique task code. |
| 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. |
| custom_fields.flight_date
| string | Related flight date (if any). |
| custom_fields.flight_code
| string | Flight code (if any). |
| custom_fields.technician
| string | Responsible technician (if any). |
| task_accounts
| array | List of accounts related to the task. |
| task_accounts.account_code
| string | Related customer/account code. |
| task_accounts.account_phone
| string | Account phone number. |
| task_accounts.contact_name
| string | Contact person name of the account. |
| task_accounts.account_name
| string | Account/customer name. |\
{
"task_name": "[L4] API form task",
"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": "Pink",
"task_code": "Task.0003",
"task_weight": 48,
"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 'https://xxxxx.getflycrm.com/api/v6.1/task' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <your_api_key>' \
--header 'Cookie: v6_getflycrm_session=<your_session_token>' \
--data '{
"task_name": "[L4] API form task",
"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": "Pink",
"task_code": "Task.0003",
"task_weight": 48,
"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 added",
"data": {
"task_id": 98,
"task_code": "Task.0003"
}
}
Description of Fields in Response
| Field | Data Type | Description |
|--------|-------------|--------|
| message
| string | API status message. |
| data.task_id
| integer | ID of the newly created task. |
| data.task_code
| string | Code of the newly created task. |\
Notes
- This API is used to add a new task.
- If successful, the API returns the message
"Successfully added"
along with thetask_id
andtask_code
of the newly created task.