curl --request PUT \
--url https://api.contractorscloud.com/api/v1/leads/{leadId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "jane.smith@example.com",
"phone": "(555) 201-4477"
}
'import requests
url = "https://api.contractorscloud.com/api/v1/leads/{leadId}"
payload = {
"email": "jane.smith@example.com",
"phone": "(555) 201-4477"
}
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({email: 'jane.smith@example.com', phone: '(555) 201-4477'})
};
fetch('https://api.contractorscloud.com/api/v1/leads/{leadId}', 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/leads/{leadId}",
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([
'email' => 'jane.smith@example.com',
'phone' => '(555) 201-4477'
]),
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/leads/{leadId}"
payload := strings.NewReader("{\n \"email\": \"jane.smith@example.com\",\n \"phone\": \"(555) 201-4477\"\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/leads/{leadId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jane.smith@example.com\",\n \"phone\": \"(555) 201-4477\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/leads/{leadId}")
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 \"email\": \"jane.smith@example.com\",\n \"phone\": \"(555) 201-4477\"\n}"
response = http.request(request)
puts response.read_body{
"id": "7c2e4f1a-9b3d-4e6c-8a1f-2d5b9c3e7a44",
"tenant_id": 12,
"lead_connection_id": "3f9a2b6c-1d4e-4a8b-9c2f-7e5d6a1b8c30",
"transaction_id": "e1a4c9d2-6b7f-4a3e-9c8d-1f2b3a4c5d6e",
"created_by": 1159,
"project_id": null,
"status": "needs-review",
"status_message": "This lead has been modified and needs to be re-processed.",
"received_at": "2025-02-10 09:15:03",
"last_process_started_at": "2025-02-10 09:15:05",
"last_process_ended_at": "2025-02-10 09:15:07",
"validation_errors": {
"email": [
"The email field is required."
]
},
"derived_data": {
"first_name": "Jane",
"last_name": "Smith",
"phone": "(555) 201-4477"
},
"data": {
"first_name": "Jane",
"last_name": "Smith",
"email": "jane.smith@example.com",
"phone": "(555) 201-4477"
},
"created_at": "2025-02-10 09:15:03",
"updated_at": "2025-02-10 09:32:41"
}{
"message": "Unauthenticated."
}{
"message": "The requested resource could not be found."
}{
"message": "This lead is currently queued for processing and cannot be updated at this time."
}Update lead
Edits a lead’s submitted data. Each key in the request body is deep-merged into the lead’s existing data — new keys are added, matching keys are overwritten, and nested objects are merged key by key rather than replaced outright. Everything you don’t send is left untouched (a partial patch, not a full replacement). A successful edit resets the lead’s status to needs-review so it can be re-processed — call Process lead once you’re ready to re-validate it.
curl --request PUT \
--url https://api.contractorscloud.com/api/v1/leads/{leadId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "jane.smith@example.com",
"phone": "(555) 201-4477"
}
'import requests
url = "https://api.contractorscloud.com/api/v1/leads/{leadId}"
payload = {
"email": "jane.smith@example.com",
"phone": "(555) 201-4477"
}
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({email: 'jane.smith@example.com', phone: '(555) 201-4477'})
};
fetch('https://api.contractorscloud.com/api/v1/leads/{leadId}', 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/leads/{leadId}",
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([
'email' => 'jane.smith@example.com',
'phone' => '(555) 201-4477'
]),
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/leads/{leadId}"
payload := strings.NewReader("{\n \"email\": \"jane.smith@example.com\",\n \"phone\": \"(555) 201-4477\"\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/leads/{leadId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jane.smith@example.com\",\n \"phone\": \"(555) 201-4477\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/leads/{leadId}")
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 \"email\": \"jane.smith@example.com\",\n \"phone\": \"(555) 201-4477\"\n}"
response = http.request(request)
puts response.read_body{
"id": "7c2e4f1a-9b3d-4e6c-8a1f-2d5b9c3e7a44",
"tenant_id": 12,
"lead_connection_id": "3f9a2b6c-1d4e-4a8b-9c2f-7e5d6a1b8c30",
"transaction_id": "e1a4c9d2-6b7f-4a3e-9c8d-1f2b3a4c5d6e",
"created_by": 1159,
"project_id": null,
"status": "needs-review",
"status_message": "This lead has been modified and needs to be re-processed.",
"received_at": "2025-02-10 09:15:03",
"last_process_started_at": "2025-02-10 09:15:05",
"last_process_ended_at": "2025-02-10 09:15:07",
"validation_errors": {
"email": [
"The email field is required."
]
},
"derived_data": {
"first_name": "Jane",
"last_name": "Smith",
"phone": "(555) 201-4477"
},
"data": {
"first_name": "Jane",
"last_name": "Smith",
"email": "jane.smith@example.com",
"phone": "(555) 201-4477"
},
"created_at": "2025-02-10 09:15:03",
"updated_at": "2025-02-10 09:32:41"
}{
"message": "Unauthenticated."
}{
"message": "The requested resource could not be found."
}{
"message": "This lead is currently queued for processing and cannot be updated at this time."
}Authorizations
Body
The fields to add or change in the lead's data, as key/value pairs.
Response
The updated lead.
Groups every lead submitted in the same request. Filter List leads by filter[transaction_id] to retrieve them all.
"e1a4c9d2-6b7f-4a3e-9c8d-1f2b3a4c5d6e"
The lead's current position in its lifecycle: queued — waiting to be processed; processing — actively being processed; needs-review — processing finished but the data failed validation and needs correction; ready — passed validation and can be converted into a project; error — processing failed unexpectedly; converting — actively being converted into a project; successful — has been converted into a project. See the Leads guide for the full lifecycle.
queued, processing, needs-review, ready, error, converting, successful "needs-review"
The raw submitted lead data, parsed into key/value pairs. Field names are defined by your lead connection's field mapping. Edited with Update lead.