Update contact
curl --request PUT \
--url https://api.contractorscloud.com/api/v1/contacts/{contactId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Senior Project Manager",
"phone_cell": "(555) 201-4477",
"status": true
}
'import requests
url = "https://api.contractorscloud.com/api/v1/contacts/{contactId}"
payload = {
"title": "Senior Project Manager",
"phone_cell": "(555) 201-4477",
"status": 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({title: 'Senior Project Manager', phone_cell: '(555) 201-4477', status: true})
};
fetch('https://api.contractorscloud.com/api/v1/contacts/{contactId}', 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/contacts/{contactId}",
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([
'title' => 'Senior Project Manager',
'phone_cell' => '(555) 201-4477',
'status' => 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/contacts/{contactId}"
payload := strings.NewReader("{\n \"title\": \"Senior Project Manager\",\n \"phone_cell\": \"(555) 201-4477\",\n \"status\": 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/contacts/{contactId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Senior Project Manager\",\n \"phone_cell\": \"(555) 201-4477\",\n \"status\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/contacts/{contactId}")
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 \"title\": \"Senior Project Manager\",\n \"phone_cell\": \"(555) 201-4477\",\n \"status\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 4821,
"tenant_id": 12,
"owned_by": 1159,
"nick_name": null,
"first_name": "Jane",
"last_name": "Smith",
"prefix": "Ms.",
"title": "Senior Project Manager",
"department": "Operations",
"email": "jane.smith@example.com",
"email_alt": null,
"phone_home": null,
"phone_cell": "(555) 201-4477",
"phone_fax": null,
"phone_work": "(555) 201-4400",
"phone_work_ext": "118",
"address_street": "482 Birchwood Ave",
"address_city": "Madison",
"address_state": "WI",
"address_zip": "53703",
"status": true,
"comment": null,
"merge_status": 0,
"import_name": null,
"import_id": null,
"created_at": "2024-11-02 14:35:09",
"updated_at": "2025-01-09 11:48:02"
}{
"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."
]
}
}Contacts
Update contact
Updates an existing contact. Only the fields you send are changed; all fields are optional, but first_name and last_name cannot be set to empty values.
PUT
/
contacts
/
{contactId}
Update contact
curl --request PUT \
--url https://api.contractorscloud.com/api/v1/contacts/{contactId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Senior Project Manager",
"phone_cell": "(555) 201-4477",
"status": true
}
'import requests
url = "https://api.contractorscloud.com/api/v1/contacts/{contactId}"
payload = {
"title": "Senior Project Manager",
"phone_cell": "(555) 201-4477",
"status": 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({title: 'Senior Project Manager', phone_cell: '(555) 201-4477', status: true})
};
fetch('https://api.contractorscloud.com/api/v1/contacts/{contactId}', 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/contacts/{contactId}",
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([
'title' => 'Senior Project Manager',
'phone_cell' => '(555) 201-4477',
'status' => 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/contacts/{contactId}"
payload := strings.NewReader("{\n \"title\": \"Senior Project Manager\",\n \"phone_cell\": \"(555) 201-4477\",\n \"status\": 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/contacts/{contactId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Senior Project Manager\",\n \"phone_cell\": \"(555) 201-4477\",\n \"status\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/contacts/{contactId}")
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 \"title\": \"Senior Project Manager\",\n \"phone_cell\": \"(555) 201-4477\",\n \"status\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 4821,
"tenant_id": 12,
"owned_by": 1159,
"nick_name": null,
"first_name": "Jane",
"last_name": "Smith",
"prefix": "Ms.",
"title": "Senior Project Manager",
"department": "Operations",
"email": "jane.smith@example.com",
"email_alt": null,
"phone_home": null,
"phone_cell": "(555) 201-4477",
"phone_fax": null,
"phone_work": "(555) 201-4400",
"phone_work_ext": "118",
"address_street": "482 Birchwood Ave",
"address_city": "Madison",
"address_state": "WI",
"address_zip": "53703",
"status": true,
"comment": null,
"merge_status": 0,
"import_name": null,
"import_id": null,
"created_at": "2024-11-02 14:35:09",
"updated_at": "2025-01-09 11:48:02"
}{
"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 contact.