UpdateTask

Function to update a task. Only the sent fields are changed. The reporter cannot be changed. Unknown IDs and invalid values return code 400

PUT https://rest.crmango.com/api/UpdateTask

Authorization

1 Sent in the request headers
Bearer varchar

Auth token (required in Authorization header)

Body data

32 Sent in the request body
task_id integer

ID of the task to update (required)

task_name varchar

New task name (max 255 chars). Characters ' " ; < > are removed

assignee_id integer

New assignee. 0 = no assignee
Reference: GetAllUsers

watcher_id varchar

Comma-separated IDs of watching users (e.g. "3,7"). Replaces the whole list, empty string = no watchers
Reference: GetAllUsers

is_private integer

Private task (0 = public, 1 = private)

priority integer

Task priority (0 = lowest, 5 = highest)

company_id integer

ID of the related company. 0 = detach the company

task_type_id integer

Task type. 0 = no type
Reference: GetAllLists

label_id varchar

Comma-separated label IDs (e.g. "4,6"). Replaces the whole list, empty string = no labels

status integer

Task status. Status 2 = done (progress 100, completion time set); other status reopens a done task
Reference: GetAllLists

progress integer

Task completion percentage (0–100). 100 = done

task_done integer

1 = mark as done, 0 = reopen

done_date date

Completion date when marking as done (Y-m-d). Default is the current time

description varchar

New description, replaces the old one (auto-encoded to base64 if not already). Empty string = clear. Characters ' " ; < > are removed

is_description_base64 integer

1 = description is already base64 encoded, 0 = will be encoded server-side

task_deadline_date date

New deadline (Y-m-d or Y-m-d H:i). Empty string = no deadline

planned_start date

Planned start (Y-m-d H:i). Empty string = clear

planned_end date

Planned end (Y-m-d H:i), must be after planned start. Empty string = clear

order_id integer

Linked order ID, the change is applied to sub-tasks as well. 0 = detach the order

required_act_type_id integer

Required activity type (optional)

act_id integer

Activity ID (optional)

recurring_task_id integer

ID of the recurring task template. 0 = detach

days_before integer

How many days before the deadline to notify

repeat_after integer

How many days after completion to repeat the task (0–5000, 0 = no repeat). When a task with repeat is completed, a copy with a new deadline is created

repeat_after_km integer

Repeat after this many kilometers (vehicles)

km_before integer

How many kilometers before the due tachometer status to notify

tachometer_status integer

Tachometer status at which the task is due

vehicle_id integer

ID of the related vehicle. 0 = detach

trailer_id integer

ID of the related trailer. 0 = detach

driver_id integer

ID of the driver (contact of the driver type). 0 = detach

register_id integer

ID of the related register record. Used only together with register_type_id

register_type_id integer

ID of the register type. Used only together with register_id

Response

2 HTTP 200

Function to update a task. Only the sent fields are changed. The reporter cannot be changed. Unknown IDs and invalid values return code 400

code integer

HTTP status code (200 = OK)

message varchar

Confirmation message

Example request

curl --request PUT \
  --url 'https://rest.crmango.com/api/UpdateTask' \
  --header 'Authorization: Bearer auth_token' \
  --header 'Content-Type: application/json' \
  --data '{
    {
      "task_id": 1234,
      "assignee_id": 12,
      "priority": 4,
      "status": 3,
      "progress": 50,
      "label_id": "4,6",
      "task_deadline_date": "2026-11-30 12:00"
    }
  }'
{
    "code": 200,
    "message": "Task has been updated"
}