Leads
Update lead
Updates an existing lead. When updating a lead’s stage, supply stage_id instead of stage_name. Requires crm:write scope.
PATCH
/
leads
/
{id}
Update Lead
curl --request PATCH \
--url https://crm-api.automatebusiness.com/api/v1/integrations-public/leads/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Acme Corp - Expanded Deal",
"email": "lead@acmecorp.com",
"phone": "+15559876543",
"stage_id": "stage_proposal_sent",
"assigned_to": "user_michael",
"tags": [
"enterprise",
"high-priority"
],
"custom_fields": {
"deal_value": 75000
}
}
'import requests
url = "https://crm-api.automatebusiness.com/api/v1/integrations-public/leads/{id}"
payload = {
"name": "Acme Corp - Expanded Deal",
"email": "lead@acmecorp.com",
"phone": "+15559876543",
"stage_id": "stage_proposal_sent",
"assigned_to": "user_michael",
"tags": ["enterprise", "high-priority"],
"custom_fields": { "deal_value": 75000 }
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Corp - Expanded Deal',
email: 'lead@acmecorp.com',
phone: '+15559876543',
stage_id: 'stage_proposal_sent',
assigned_to: 'user_michael',
tags: ['enterprise', 'high-priority'],
custom_fields: {deal_value: 75000}
})
};
fetch('https://crm-api.automatebusiness.com/api/v1/integrations-public/leads/{id}', 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://crm-api.automatebusiness.com/api/v1/integrations-public/leads/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Acme Corp - Expanded Deal',
'email' => 'lead@acmecorp.com',
'phone' => '+15559876543',
'stage_id' => 'stage_proposal_sent',
'assigned_to' => 'user_michael',
'tags' => [
'enterprise',
'high-priority'
],
'custom_fields' => [
'deal_value' => 75000
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://crm-api.automatebusiness.com/api/v1/integrations-public/leads/{id}"
payload := strings.NewReader("{\n \"name\": \"Acme Corp - Expanded Deal\",\n \"email\": \"lead@acmecorp.com\",\n \"phone\": \"+15559876543\",\n \"stage_id\": \"stage_proposal_sent\",\n \"assigned_to\": \"user_michael\",\n \"tags\": [\n \"enterprise\",\n \"high-priority\"\n ],\n \"custom_fields\": {\n \"deal_value\": 75000\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.patch("https://crm-api.automatebusiness.com/api/v1/integrations-public/leads/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Corp - Expanded Deal\",\n \"email\": \"lead@acmecorp.com\",\n \"phone\": \"+15559876543\",\n \"stage_id\": \"stage_proposal_sent\",\n \"assigned_to\": \"user_michael\",\n \"tags\": [\n \"enterprise\",\n \"high-priority\"\n ],\n \"custom_fields\": {\n \"deal_value\": 75000\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://crm-api.automatebusiness.com/api/v1/integrations-public/leads/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Corp - Expanded Deal\",\n \"email\": \"lead@acmecorp.com\",\n \"phone\": \"+15559876543\",\n \"stage_id\": \"stage_proposal_sent\",\n \"assigned_to\": \"user_michael\",\n \"tags\": [\n \"enterprise\",\n \"high-priority\"\n ],\n \"custom_fields\": {\n \"deal_value\": 75000\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "lead_890ef12a",
"name": "Acme Corp Enterprise Deal",
"email": "lead@acmecorp.com",
"phone": "+15559876543",
"pipeline_id": "pipe_default",
"stage_id": "stage_contacted",
"stage_name": "Contacted",
"assigned_to": "user_sarah",
"tags": [
"enterprise",
"q4-inbound"
],
"custom_fields": {
"deal_value": 50000,
"industry": "Technology"
},
"meta_attribution": {
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "fall_promo"
},
"created_at": "2026-10-26T09:30:00.000Z",
"updated_at": "2026-10-26T09:30:00.000Z"
},
"error": null
}{
"success": false,
"data": null,
"error": {
"message": "Validation failed",
"details": [
{
"message": "Required",
"field": "email",
"code": "invalid_type"
}
]
}
}{
"success": false,
"data": null,
"error": {
"message": "Invalid or missing API key."
}
}{
"success": false,
"data": null,
"error": {
"message": "Forbidden: insufficient permissions for this operation."
}
}{
"success": false,
"data": null,
"error": {
"message": "Resource not found"
}
}Updates fields on an existing lead record.
Stage update behavior
Unlike lead creation (which acceptsstage_name), updating a lead’s stage requires providing the target stage ID in stage_id.
Path parameters
id(string, required): The unique identifier of the lead to update.
Required permissions
Requires an API key with thecrm:write scope.Authorizations
Workspace API key header. The key implicitly determines your workspace isolation. Scopes: crm:read for GET/HEAD/OPTIONS, crm:write for POST/PATCH/PUT/DELETE.
Path Parameters
The unique identifier of the lead
Body
application/json
Fields to update on an existing lead. Note that updates accept stage_id rather than stage_name.
Example:
"Acme Corp - Expanded Deal"
Example:
"lead@acmecorp.com"
Example:
"+15559876543"
Stage ID to transition this lead into
Example:
"stage_proposal_sent"
Example:
"user_michael"
Example:
["enterprise", "high-priority"]
Example:
{ "deal_value": 75000 }
⌘I
Update Lead
curl --request PATCH \
--url https://crm-api.automatebusiness.com/api/v1/integrations-public/leads/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Acme Corp - Expanded Deal",
"email": "lead@acmecorp.com",
"phone": "+15559876543",
"stage_id": "stage_proposal_sent",
"assigned_to": "user_michael",
"tags": [
"enterprise",
"high-priority"
],
"custom_fields": {
"deal_value": 75000
}
}
'import requests
url = "https://crm-api.automatebusiness.com/api/v1/integrations-public/leads/{id}"
payload = {
"name": "Acme Corp - Expanded Deal",
"email": "lead@acmecorp.com",
"phone": "+15559876543",
"stage_id": "stage_proposal_sent",
"assigned_to": "user_michael",
"tags": ["enterprise", "high-priority"],
"custom_fields": { "deal_value": 75000 }
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Corp - Expanded Deal',
email: 'lead@acmecorp.com',
phone: '+15559876543',
stage_id: 'stage_proposal_sent',
assigned_to: 'user_michael',
tags: ['enterprise', 'high-priority'],
custom_fields: {deal_value: 75000}
})
};
fetch('https://crm-api.automatebusiness.com/api/v1/integrations-public/leads/{id}', 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://crm-api.automatebusiness.com/api/v1/integrations-public/leads/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Acme Corp - Expanded Deal',
'email' => 'lead@acmecorp.com',
'phone' => '+15559876543',
'stage_id' => 'stage_proposal_sent',
'assigned_to' => 'user_michael',
'tags' => [
'enterprise',
'high-priority'
],
'custom_fields' => [
'deal_value' => 75000
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://crm-api.automatebusiness.com/api/v1/integrations-public/leads/{id}"
payload := strings.NewReader("{\n \"name\": \"Acme Corp - Expanded Deal\",\n \"email\": \"lead@acmecorp.com\",\n \"phone\": \"+15559876543\",\n \"stage_id\": \"stage_proposal_sent\",\n \"assigned_to\": \"user_michael\",\n \"tags\": [\n \"enterprise\",\n \"high-priority\"\n ],\n \"custom_fields\": {\n \"deal_value\": 75000\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.patch("https://crm-api.automatebusiness.com/api/v1/integrations-public/leads/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Corp - Expanded Deal\",\n \"email\": \"lead@acmecorp.com\",\n \"phone\": \"+15559876543\",\n \"stage_id\": \"stage_proposal_sent\",\n \"assigned_to\": \"user_michael\",\n \"tags\": [\n \"enterprise\",\n \"high-priority\"\n ],\n \"custom_fields\": {\n \"deal_value\": 75000\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://crm-api.automatebusiness.com/api/v1/integrations-public/leads/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Corp - Expanded Deal\",\n \"email\": \"lead@acmecorp.com\",\n \"phone\": \"+15559876543\",\n \"stage_id\": \"stage_proposal_sent\",\n \"assigned_to\": \"user_michael\",\n \"tags\": [\n \"enterprise\",\n \"high-priority\"\n ],\n \"custom_fields\": {\n \"deal_value\": 75000\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "lead_890ef12a",
"name": "Acme Corp Enterprise Deal",
"email": "lead@acmecorp.com",
"phone": "+15559876543",
"pipeline_id": "pipe_default",
"stage_id": "stage_contacted",
"stage_name": "Contacted",
"assigned_to": "user_sarah",
"tags": [
"enterprise",
"q4-inbound"
],
"custom_fields": {
"deal_value": 50000,
"industry": "Technology"
},
"meta_attribution": {
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "fall_promo"
},
"created_at": "2026-10-26T09:30:00.000Z",
"updated_at": "2026-10-26T09:30:00.000Z"
},
"error": null
}{
"success": false,
"data": null,
"error": {
"message": "Validation failed",
"details": [
{
"message": "Required",
"field": "email",
"code": "invalid_type"
}
]
}
}{
"success": false,
"data": null,
"error": {
"message": "Invalid or missing API key."
}
}{
"success": false,
"data": null,
"error": {
"message": "Forbidden: insufficient permissions for this operation."
}
}{
"success": false,
"data": null,
"error": {
"message": "Resource not found"
}
}