Create task
curl --request POST \
--url https://api.contractorscloud.com/api/v1/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "Follow up on Smith Residence estimate",
"due_at": "2025-02-20 17:00:00",
"assignee_type": "u",
"assignee_id": 1204,
"project_id": 9103,
"is_high_priority": true,
"notifies_on_create": true,
"notifies_on_complete": true
}
'import requests
url = "https://api.contractorscloud.com/api/v1/tasks"
payload = {
"subject": "Follow up on Smith Residence estimate",
"due_at": "2025-02-20 17:00:00",
"assignee_type": "u",
"assignee_id": 1204,
"project_id": 9103,
"is_high_priority": True,
"notifies_on_create": True,
"notifies_on_complete": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subject: 'Follow up on Smith Residence estimate',
due_at: '2025-02-20 17:00:00',
assignee_type: 'u',
assignee_id: 1204,
project_id: 9103,
is_high_priority: true,
notifies_on_create: true,
notifies_on_complete: true
})
};
fetch('https://api.contractorscloud.com/api/v1/tasks', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subject' => 'Follow up on Smith Residence estimate',
'due_at' => '2025-02-20 17:00:00',
'assignee_type' => 'u',
'assignee_id' => 1204,
'project_id' => 9103,
'is_high_priority' => true,
'notifies_on_create' => true,
'notifies_on_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"
payload := strings.NewReader("{\n \"subject\": \"Follow up on Smith Residence estimate\",\n \"due_at\": \"2025-02-20 17:00:00\",\n \"assignee_type\": \"u\",\n \"assignee_id\": 1204,\n \"project_id\": 9103,\n \"is_high_priority\": true,\n \"notifies_on_create\": true,\n \"notifies_on_complete\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.contractorscloud.com/api/v1/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"Follow up on Smith Residence estimate\",\n \"due_at\": \"2025-02-20 17:00:00\",\n \"assignee_type\": \"u\",\n \"assignee_id\": 1204,\n \"project_id\": 9103,\n \"is_high_priority\": true,\n \"notifies_on_create\": true,\n \"notifies_on_complete\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": \"Follow up on Smith Residence estimate\",\n \"due_at\": \"2025-02-20 17:00:00\",\n \"assignee_type\": \"u\",\n \"assignee_id\": 1204,\n \"project_id\": 9103,\n \"is_high_priority\": true,\n \"notifies_on_create\": true,\n \"notifies_on_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": null,
"assignee_type": "u",
"assignee_id": 1204,
"assignee_name": "Mike Johnson",
"is_complete": false,
"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-20 17:00:00",
"created_at": "2025-02-10 09:20:00",
"updated_at": "2025-02-10 09:20:00",
"completed_at": null
}{
"message": "Unauthenticated."
}{
"message": "The first name field is required.",
"errors": {
"first_name": [
"The first name field is required."
]
}
}Tasks
Create task
Creates a new task and returns the created resource. A system note documenting the creation is added to the task’s notes automatically, and when the task is linked to a project, a note is also added to that project’s activity feed. When notifies_on_create is true, the assignee (or each member of an assigned team) may receive an in-app notification.
POST
/
tasks
Create task
curl --request POST \
--url https://api.contractorscloud.com/api/v1/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "Follow up on Smith Residence estimate",
"due_at": "2025-02-20 17:00:00",
"assignee_type": "u",
"assignee_id": 1204,
"project_id": 9103,
"is_high_priority": true,
"notifies_on_create": true,
"notifies_on_complete": true
}
'import requests
url = "https://api.contractorscloud.com/api/v1/tasks"
payload = {
"subject": "Follow up on Smith Residence estimate",
"due_at": "2025-02-20 17:00:00",
"assignee_type": "u",
"assignee_id": 1204,
"project_id": 9103,
"is_high_priority": True,
"notifies_on_create": True,
"notifies_on_complete": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subject: 'Follow up on Smith Residence estimate',
due_at: '2025-02-20 17:00:00',
assignee_type: 'u',
assignee_id: 1204,
project_id: 9103,
is_high_priority: true,
notifies_on_create: true,
notifies_on_complete: true
})
};
fetch('https://api.contractorscloud.com/api/v1/tasks', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subject' => 'Follow up on Smith Residence estimate',
'due_at' => '2025-02-20 17:00:00',
'assignee_type' => 'u',
'assignee_id' => 1204,
'project_id' => 9103,
'is_high_priority' => true,
'notifies_on_create' => true,
'notifies_on_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"
payload := strings.NewReader("{\n \"subject\": \"Follow up on Smith Residence estimate\",\n \"due_at\": \"2025-02-20 17:00:00\",\n \"assignee_type\": \"u\",\n \"assignee_id\": 1204,\n \"project_id\": 9103,\n \"is_high_priority\": true,\n \"notifies_on_create\": true,\n \"notifies_on_complete\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.contractorscloud.com/api/v1/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subject\": \"Follow up on Smith Residence estimate\",\n \"due_at\": \"2025-02-20 17:00:00\",\n \"assignee_type\": \"u\",\n \"assignee_id\": 1204,\n \"project_id\": 9103,\n \"is_high_priority\": true,\n \"notifies_on_create\": true,\n \"notifies_on_complete\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subject\": \"Follow up on Smith Residence estimate\",\n \"due_at\": \"2025-02-20 17:00:00\",\n \"assignee_type\": \"u\",\n \"assignee_id\": 1204,\n \"project_id\": 9103,\n \"is_high_priority\": true,\n \"notifies_on_create\": true,\n \"notifies_on_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": null,
"assignee_type": "u",
"assignee_id": 1204,
"assignee_name": "Mike Johnson",
"is_complete": false,
"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-20 17:00:00",
"created_at": "2025-02-10 09:20:00",
"updated_at": "2025-02-10 09:20:00",
"completed_at": null
}{
"message": "Unauthenticated."
}{
"message": "The first name field is required.",
"errors": {
"first_name": [
"The first name field is required."
]
}
}Authorizations
Body
application/json
Response
The created task.