Update task
curl --request PUT \
--url https://api.contractorscloud.com/api/v1/tasks/{taskId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"due_at": "2025-02-21 17:00:00",
"is_complete": true
}
'import requests
url = "https://api.contractorscloud.com/api/v1/tasks/{taskId}"
payload = {
"due_at": "2025-02-21 17:00:00",
"is_complete": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({due_at: '2025-02-21 17:00:00', is_complete: true})
};
fetch('https://api.contractorscloud.com/api/v1/tasks/{taskId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.contractorscloud.com/api/v1/tasks/{taskId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'due_at' => '2025-02-21 17:00:00',
'is_complete' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.contractorscloud.com/api/v1/tasks/{taskId}"
payload := strings.NewReader("{\n \"due_at\": \"2025-02-21 17:00:00\",\n \"is_complete\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.contractorscloud.com/api/v1/tasks/{taskId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"due_at\": \"2025-02-21 17:00:00\",\n \"is_complete\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/tasks/{taskId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"due_at\": \"2025-02-21 17:00:00\",\n \"is_complete\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 7204,
"tenant_id": 12,
"project_id": 9103,
"project_milestone_id": null,
"project_milestone_task_id": null,
"created_by": 1159,
"completed_by": 1159,
"assignee_type": "u",
"assignee_id": 1204,
"assignee_name": "Mike Johnson",
"is_complete": true,
"is_high_priority": true,
"subject": "Follow up on Smith Residence estimate",
"comment": null,
"created_by_name": "Jane Doe",
"notifies_on_create": true,
"notifies_on_complete": true,
"due_at": "2025-02-21 17:00:00",
"created_at": "2025-02-10 09:20:00",
"updated_at": "2025-02-15 11:05:00",
"completed_at": "2025-02-15 11:05:00"
}{
"message": "Unauthenticated."
}{
"message": "The requested resource could not be found."
}{
"message": "The first name field is required.",
"errors": {
"first_name": [
"The first name field is required."
]
}
}Tasks
Update task
Updates an existing task. Only the fields you send are changed; all fields are optional, but subject cannot be set to an empty value.
Request format
- project_milestone_id / project_milestone_task_id — can only be set when the task is created; sending them here has no effect.
- project_id — can be changed to another project but can’t be cleared to null.
- is_complete — setting it to
truerecordscompleted_atandcompleted_byautomatically; setting it back tofalseclears them.
Side effects
Every change is recorded as a note on the task, and when the task is linked to a project, a note is added to that project’s activity feed and the project’s workflow progress may update automatically. Involved users — the creator and the assignee — may receive in-app notifications about the update.
PUT
/
tasks
/
{taskId}
Update task
curl --request PUT \
--url https://api.contractorscloud.com/api/v1/tasks/{taskId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"due_at": "2025-02-21 17:00:00",
"is_complete": true
}
'import requests
url = "https://api.contractorscloud.com/api/v1/tasks/{taskId}"
payload = {
"due_at": "2025-02-21 17:00:00",
"is_complete": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({due_at: '2025-02-21 17:00:00', is_complete: true})
};
fetch('https://api.contractorscloud.com/api/v1/tasks/{taskId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.contractorscloud.com/api/v1/tasks/{taskId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'due_at' => '2025-02-21 17:00:00',
'is_complete' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.contractorscloud.com/api/v1/tasks/{taskId}"
payload := strings.NewReader("{\n \"due_at\": \"2025-02-21 17:00:00\",\n \"is_complete\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.contractorscloud.com/api/v1/tasks/{taskId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"due_at\": \"2025-02-21 17:00:00\",\n \"is_complete\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/tasks/{taskId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"due_at\": \"2025-02-21 17:00:00\",\n \"is_complete\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 7204,
"tenant_id": 12,
"project_id": 9103,
"project_milestone_id": null,
"project_milestone_task_id": null,
"created_by": 1159,
"completed_by": 1159,
"assignee_type": "u",
"assignee_id": 1204,
"assignee_name": "Mike Johnson",
"is_complete": true,
"is_high_priority": true,
"subject": "Follow up on Smith Residence estimate",
"comment": null,
"created_by_name": "Jane Doe",
"notifies_on_create": true,
"notifies_on_complete": true,
"due_at": "2025-02-21 17:00:00",
"created_at": "2025-02-10 09:20:00",
"updated_at": "2025-02-15 11:05:00",
"completed_at": "2025-02-15 11:05:00"
}{
"message": "Unauthenticated."
}{
"message": "The requested resource could not be found."
}{
"message": "The first name field is required.",
"errors": {
"first_name": [
"The first name field is required."
]
}
}Authorizations
Body
application/json
Response
The updated task.