curl --request PUT \
--url https://api.contractorscloud.com/api/v1/lead-connections/{leadConnectionId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Website Contact Form (Spanish)",
"is_active": false
}
'import requests
url = "https://api.contractorscloud.com/api/v1/lead-connections/{leadConnectionId}"
payload = {
"name": "Website Contact Form (Spanish)",
"is_active": False
}
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({name: 'Website Contact Form (Spanish)', is_active: false})
};
fetch('https://api.contractorscloud.com/api/v1/lead-connections/{leadConnectionId}', 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/lead-connections/{leadConnectionId}",
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([
'name' => 'Website Contact Form (Spanish)',
'is_active' => false
]),
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/lead-connections/{leadConnectionId}"
payload := strings.NewReader("{\n \"name\": \"Website Contact Form (Spanish)\",\n \"is_active\": false\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/lead-connections/{leadConnectionId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Website Contact Form (Spanish)\",\n \"is_active\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/lead-connections/{leadConnectionId}")
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 \"name\": \"Website Contact Form (Spanish)\",\n \"is_active\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "5b8e3f2a-9c41-4d6b-8a2e-3f7c1d9b6e50",
"tenant_id": 12,
"company_id": 6,
"event_id": null,
"lead_source_id": 44,
"workflow_id": null,
"rep_primary_id": 1159,
"site_type_id": null,
"status_id": null,
"is_active": false,
"data_type": "json",
"name": "Website Contact Form (Spanish)",
"description": "Leads submitted from the marketing site's contact form.",
"created_at": "2025-02-10 10:00:00",
"updated_at": "2025-02-11 09:30:00",
"last_lead_received_at": null
}{
"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."
]
}
}Update lead connection
Updates an existing lead connection. Only the fields you send are changed; all fields are optional. company_id cannot be changed after creation — the API ignores it if you send it here.
curl --request PUT \
--url https://api.contractorscloud.com/api/v1/lead-connections/{leadConnectionId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Website Contact Form (Spanish)",
"is_active": false
}
'import requests
url = "https://api.contractorscloud.com/api/v1/lead-connections/{leadConnectionId}"
payload = {
"name": "Website Contact Form (Spanish)",
"is_active": False
}
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({name: 'Website Contact Form (Spanish)', is_active: false})
};
fetch('https://api.contractorscloud.com/api/v1/lead-connections/{leadConnectionId}', 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/lead-connections/{leadConnectionId}",
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([
'name' => 'Website Contact Form (Spanish)',
'is_active' => false
]),
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/lead-connections/{leadConnectionId}"
payload := strings.NewReader("{\n \"name\": \"Website Contact Form (Spanish)\",\n \"is_active\": false\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/lead-connections/{leadConnectionId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Website Contact Form (Spanish)\",\n \"is_active\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/lead-connections/{leadConnectionId}")
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 \"name\": \"Website Contact Form (Spanish)\",\n \"is_active\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "5b8e3f2a-9c41-4d6b-8a2e-3f7c1d9b6e50",
"tenant_id": 12,
"company_id": 6,
"event_id": null,
"lead_source_id": 44,
"workflow_id": null,
"rep_primary_id": 1159,
"site_type_id": null,
"status_id": null,
"is_active": false,
"data_type": "json",
"name": "Website Contact Form (Spanish)",
"description": "Leads submitted from the marketing site's contact form.",
"created_at": "2025-02-10 10:00:00",
"updated_at": "2025-02-11 09:30:00",
"last_lead_received_at": null
}{
"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
Response
The updated lead connection.
The id of the company within your organization that owns this connection. See Company.
6
The id of the marketing event this connection is associated with. Null if not set. See Event.
The id of the lead source configured for the company that leads from this connection are attributed to. Null if not set. A lead source is a marketing channel configuration in Contractors Cloud — distinct from the Lead resource returned by this API. See Lead Source.
44
The id of the workflow assigned to projects created from leads through this connection. Null if not set. See Workflow.