Create contact
curl --request POST \
--url https://api.contractorscloud.com/api/v1/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "Jane",
"last_name": "Smith",
"title": "Project Manager",
"department": "Operations",
"email": "jane.smith@example.com",
"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,
"owned_by": 1159
}
'import requests
url = "https://api.contractorscloud.com/api/v1/contacts"
payload = {
"first_name": "Jane",
"last_name": "Smith",
"title": "Project Manager",
"department": "Operations",
"email": "jane.smith@example.com",
"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,
"owned_by": 1159
}
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({
first_name: 'Jane',
last_name: 'Smith',
title: 'Project Manager',
department: 'Operations',
email: 'jane.smith@example.com',
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,
owned_by: 1159
})
};
fetch('https://api.contractorscloud.com/api/v1/contacts', 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",
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([
'first_name' => 'Jane',
'last_name' => 'Smith',
'title' => 'Project Manager',
'department' => 'Operations',
'email' => 'jane.smith@example.com',
'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,
'owned_by' => 1159
]),
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"
payload := strings.NewReader("{\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"title\": \"Project Manager\",\n \"department\": \"Operations\",\n \"email\": \"jane.smith@example.com\",\n \"phone_work\": \"(555) 201-4400\",\n \"phone_work_ext\": \"118\",\n \"address_street\": \"482 Birchwood Ave\",\n \"address_city\": \"Madison\",\n \"address_state\": \"WI\",\n \"address_zip\": \"53703\",\n \"status\": true,\n \"owned_by\": 1159\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/contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"title\": \"Project Manager\",\n \"department\": \"Operations\",\n \"email\": \"jane.smith@example.com\",\n \"phone_work\": \"(555) 201-4400\",\n \"phone_work_ext\": \"118\",\n \"address_street\": \"482 Birchwood Ave\",\n \"address_city\": \"Madison\",\n \"address_state\": \"WI\",\n \"address_zip\": \"53703\",\n \"status\": true,\n \"owned_by\": 1159\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/contacts")
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 \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"title\": \"Project Manager\",\n \"department\": \"Operations\",\n \"email\": \"jane.smith@example.com\",\n \"phone_work\": \"(555) 201-4400\",\n \"phone_work_ext\": \"118\",\n \"address_street\": \"482 Birchwood Ave\",\n \"address_city\": \"Madison\",\n \"address_state\": \"WI\",\n \"address_zip\": \"53703\",\n \"status\": true,\n \"owned_by\": 1159\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": null,
"title": "Project Manager",
"department": "Operations",
"email": "jane.smith@example.com",
"email_alt": null,
"phone_home": null,
"phone_cell": null,
"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": "2025-01-08 09:12:44",
"updated_at": "2025-01-08 09:12:44"
}{
"message": "Unauthenticated."
}{
"message": "The first name field is required.",
"errors": {
"first_name": [
"The first name field is required."
]
}
}Contacts
Create contact
Creates a new contact and returns the created resource.
POST
/
contacts
Create contact
curl --request POST \
--url https://api.contractorscloud.com/api/v1/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "Jane",
"last_name": "Smith",
"title": "Project Manager",
"department": "Operations",
"email": "jane.smith@example.com",
"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,
"owned_by": 1159
}
'import requests
url = "https://api.contractorscloud.com/api/v1/contacts"
payload = {
"first_name": "Jane",
"last_name": "Smith",
"title": "Project Manager",
"department": "Operations",
"email": "jane.smith@example.com",
"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,
"owned_by": 1159
}
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({
first_name: 'Jane',
last_name: 'Smith',
title: 'Project Manager',
department: 'Operations',
email: 'jane.smith@example.com',
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,
owned_by: 1159
})
};
fetch('https://api.contractorscloud.com/api/v1/contacts', 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",
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([
'first_name' => 'Jane',
'last_name' => 'Smith',
'title' => 'Project Manager',
'department' => 'Operations',
'email' => 'jane.smith@example.com',
'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,
'owned_by' => 1159
]),
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"
payload := strings.NewReader("{\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"title\": \"Project Manager\",\n \"department\": \"Operations\",\n \"email\": \"jane.smith@example.com\",\n \"phone_work\": \"(555) 201-4400\",\n \"phone_work_ext\": \"118\",\n \"address_street\": \"482 Birchwood Ave\",\n \"address_city\": \"Madison\",\n \"address_state\": \"WI\",\n \"address_zip\": \"53703\",\n \"status\": true,\n \"owned_by\": 1159\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/contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"title\": \"Project Manager\",\n \"department\": \"Operations\",\n \"email\": \"jane.smith@example.com\",\n \"phone_work\": \"(555) 201-4400\",\n \"phone_work_ext\": \"118\",\n \"address_street\": \"482 Birchwood Ave\",\n \"address_city\": \"Madison\",\n \"address_state\": \"WI\",\n \"address_zip\": \"53703\",\n \"status\": true,\n \"owned_by\": 1159\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/contacts")
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 \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"title\": \"Project Manager\",\n \"department\": \"Operations\",\n \"email\": \"jane.smith@example.com\",\n \"phone_work\": \"(555) 201-4400\",\n \"phone_work_ext\": \"118\",\n \"address_street\": \"482 Birchwood Ave\",\n \"address_city\": \"Madison\",\n \"address_state\": \"WI\",\n \"address_zip\": \"53703\",\n \"status\": true,\n \"owned_by\": 1159\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": null,
"title": "Project Manager",
"department": "Operations",
"email": "jane.smith@example.com",
"email_alt": null,
"phone_home": null,
"phone_cell": null,
"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": "2025-01-08 09:12:44",
"updated_at": "2025-01-08 09:12:44"
}{
"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 contact.