curl --request POST \
--url https://api.contractorscloud.com/api/v1/teams \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Roofing Sales Team",
"leader_id": 1159,
"is_active": true
}
'import requests
url = "https://api.contractorscloud.com/api/v1/teams"
payload = {
"name": "Roofing Sales Team",
"leader_id": 1159,
"is_active": 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({name: 'Roofing Sales Team', leader_id: 1159, is_active: true})
};
fetch('https://api.contractorscloud.com/api/v1/teams', 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/teams",
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([
'name' => 'Roofing Sales Team',
'leader_id' => 1159,
'is_active' => 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/teams"
payload := strings.NewReader("{\n \"name\": \"Roofing Sales Team\",\n \"leader_id\": 1159,\n \"is_active\": 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/teams")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Roofing Sales Team\",\n \"leader_id\": 1159,\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/teams")
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 \"name\": \"Roofing Sales Team\",\n \"leader_id\": 1159,\n \"is_active\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 501,
"tenant_id": 12,
"leader_id": 1159,
"name": "Roofing Sales Team",
"comment": null,
"is_active": true
}{
"message": "Unauthenticated."
}{
"message": "The first name field is required.",
"errors": {
"first_name": [
"The first name field is required."
]
}
}Create team
Creates a new team and returns the created resource. A note documenting the creation is added to the team’s Team Notes automatically.
curl --request POST \
--url https://api.contractorscloud.com/api/v1/teams \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Roofing Sales Team",
"leader_id": 1159,
"is_active": true
}
'import requests
url = "https://api.contractorscloud.com/api/v1/teams"
payload = {
"name": "Roofing Sales Team",
"leader_id": 1159,
"is_active": 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({name: 'Roofing Sales Team', leader_id: 1159, is_active: true})
};
fetch('https://api.contractorscloud.com/api/v1/teams', 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/teams",
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([
'name' => 'Roofing Sales Team',
'leader_id' => 1159,
'is_active' => 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/teams"
payload := strings.NewReader("{\n \"name\": \"Roofing Sales Team\",\n \"leader_id\": 1159,\n \"is_active\": 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/teams")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Roofing Sales Team\",\n \"leader_id\": 1159,\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/teams")
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 \"name\": \"Roofing Sales Team\",\n \"leader_id\": 1159,\n \"is_active\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 501,
"tenant_id": 12,
"leader_id": 1159,
"name": "Roofing Sales Team",
"comment": null,
"is_active": true
}{
"message": "Unauthenticated."
}{
"message": "The first name field is required.",
"errors": {
"first_name": [
"The first name field is required."
]
}
}Authorizations
Authenticate with an API access token in the Authorization header: Authorization: Bearer <token>. Create a token from the API Access Tokens page in Contractors Cloud, under Integrations.
Body
The team's name. Required.
50"Roofing Sales Team"
The id of the user who leads this team. Required; must reference a user in your organization.
1159
Whether the team is active. Optional; defaults to true.
true
Free-form notes about the team. Optional.
65535Response
The created team.
The team's unique identifier.
501
The id of your organization's account.
12
The id of the user who leads this team.
1159
The team's name.
"Roofing Sales Team"
Free-form notes about the team. Null if not set.
Whether the team is active. Teams aren't deleted through the API — set this to false to deactivate one.
true