curl --request PATCH \
--url https://api.g1.datacrazy.io/api/v1/leads/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Guilherme Gavazzoni",
"image": "https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b",
"phone": "+55 (47) 991331190",
"email": "guilherme@datacrazy.com.br",
"source": "Google ads",
"company": "Apple",
"taxId": "108.154.702-92",
"site": "www.meulead.com.br",
"instagram": "@guilhermegavazzoni",
"address": {
"zip": "88338-130",
"address": "Avenida Brasil",
"block": "Centro",
"city": "Balneário Camboriú",
"state": "SC",
"country": "BR"
},
"sourceReferral": {
"sourceId": "2bc3d979-93a4-4e64-8903-5d9379d3de91",
"sourceUrl": "https://example.com/artigo-de-origem",
"ctwaId": "849fefab-e697-4720-9303-e788c23790cc"
},
"tags": [
{
"id": [
"<string>"
]
}
],
"lists": [
{
"id": [
"<string>"
]
}
],
"attendant": {
"id": "<string>"
},
"notes": {
"id": "<string>"
}
}
'import requests
url = "https://api.g1.datacrazy.io/api/v1/leads/{id}"
payload = {
"name": "Guilherme Gavazzoni",
"image": "https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b",
"phone": "+55 (47) 991331190",
"email": "guilherme@datacrazy.com.br",
"source": "Google ads",
"company": "Apple",
"taxId": "108.154.702-92",
"site": "www.meulead.com.br",
"instagram": "@guilhermegavazzoni",
"address": {
"zip": "88338-130",
"address": "Avenida Brasil",
"block": "Centro",
"city": "Balneário Camboriú",
"state": "SC",
"country": "BR"
},
"sourceReferral": {
"sourceId": "2bc3d979-93a4-4e64-8903-5d9379d3de91",
"sourceUrl": "https://example.com/artigo-de-origem",
"ctwaId": "849fefab-e697-4720-9303-e788c23790cc"
},
"tags": [{ "id": ["<string>"] }],
"lists": [{ "id": ["<string>"] }],
"attendant": { "id": "<string>" },
"notes": { "id": "<string>" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Guilherme Gavazzoni',
image: 'https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b',
phone: '+55 (47) 991331190',
email: 'guilherme@datacrazy.com.br',
source: 'Google ads',
company: 'Apple',
taxId: '108.154.702-92',
site: 'www.meulead.com.br',
instagram: '@guilhermegavazzoni',
address: {
zip: '88338-130',
address: 'Avenida Brasil',
block: 'Centro',
city: 'Balneário Camboriú',
state: 'SC',
country: 'BR'
},
sourceReferral: {
sourceId: '2bc3d979-93a4-4e64-8903-5d9379d3de91',
sourceUrl: 'https://example.com/artigo-de-origem',
ctwaId: '849fefab-e697-4720-9303-e788c23790cc'
},
tags: [{id: ['<string>']}],
lists: [{id: ['<string>']}],
attendant: {id: '<string>'},
notes: {id: '<string>'}
})
};
fetch('https://api.g1.datacrazy.io/api/v1/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://api.g1.datacrazy.io/api/v1/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' => 'Guilherme Gavazzoni',
'image' => 'https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b',
'phone' => '+55 (47) 991331190',
'email' => 'guilherme@datacrazy.com.br',
'source' => 'Google ads',
'company' => 'Apple',
'taxId' => '108.154.702-92',
'site' => 'www.meulead.com.br',
'instagram' => '@guilhermegavazzoni',
'address' => [
'zip' => '88338-130',
'address' => 'Avenida Brasil',
'block' => 'Centro',
'city' => 'Balneário Camboriú',
'state' => 'SC',
'country' => 'BR'
],
'sourceReferral' => [
'sourceId' => '2bc3d979-93a4-4e64-8903-5d9379d3de91',
'sourceUrl' => 'https://example.com/artigo-de-origem',
'ctwaId' => '849fefab-e697-4720-9303-e788c23790cc'
],
'tags' => [
[
'id' => [
'<string>'
]
]
],
'lists' => [
[
'id' => [
'<string>'
]
]
],
'attendant' => [
'id' => '<string>'
],
'notes' => [
'id' => '<string>'
]
]),
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.g1.datacrazy.io/api/v1/leads/{id}"
payload := strings.NewReader("{\n \"name\": \"Guilherme Gavazzoni\",\n \"image\": \"https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b\",\n \"phone\": \"+55 (47) 991331190\",\n \"email\": \"guilherme@datacrazy.com.br\",\n \"source\": \"Google ads\",\n \"company\": \"Apple\",\n \"taxId\": \"108.154.702-92\",\n \"site\": \"www.meulead.com.br\",\n \"instagram\": \"@guilhermegavazzoni\",\n \"address\": {\n \"zip\": \"88338-130\",\n \"address\": \"Avenida Brasil\",\n \"block\": \"Centro\",\n \"city\": \"Balneário Camboriú\",\n \"state\": \"SC\",\n \"country\": \"BR\"\n },\n \"sourceReferral\": {\n \"sourceId\": \"2bc3d979-93a4-4e64-8903-5d9379d3de91\",\n \"sourceUrl\": \"https://example.com/artigo-de-origem\",\n \"ctwaId\": \"849fefab-e697-4720-9303-e788c23790cc\"\n },\n \"tags\": [\n {\n \"id\": [\n \"<string>\"\n ]\n }\n ],\n \"lists\": [\n {\n \"id\": [\n \"<string>\"\n ]\n }\n ],\n \"attendant\": {\n \"id\": \"<string>\"\n },\n \"notes\": {\n \"id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.g1.datacrazy.io/api/v1/leads/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Guilherme Gavazzoni\",\n \"image\": \"https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b\",\n \"phone\": \"+55 (47) 991331190\",\n \"email\": \"guilherme@datacrazy.com.br\",\n \"source\": \"Google ads\",\n \"company\": \"Apple\",\n \"taxId\": \"108.154.702-92\",\n \"site\": \"www.meulead.com.br\",\n \"instagram\": \"@guilhermegavazzoni\",\n \"address\": {\n \"zip\": \"88338-130\",\n \"address\": \"Avenida Brasil\",\n \"block\": \"Centro\",\n \"city\": \"Balneário Camboriú\",\n \"state\": \"SC\",\n \"country\": \"BR\"\n },\n \"sourceReferral\": {\n \"sourceId\": \"2bc3d979-93a4-4e64-8903-5d9379d3de91\",\n \"sourceUrl\": \"https://example.com/artigo-de-origem\",\n \"ctwaId\": \"849fefab-e697-4720-9303-e788c23790cc\"\n },\n \"tags\": [\n {\n \"id\": [\n \"<string>\"\n ]\n }\n ],\n \"lists\": [\n {\n \"id\": [\n \"<string>\"\n ]\n }\n ],\n \"attendant\": {\n \"id\": \"<string>\"\n },\n \"notes\": {\n \"id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.g1.datacrazy.io/api/v1/leads/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Guilherme Gavazzoni\",\n \"image\": \"https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b\",\n \"phone\": \"+55 (47) 991331190\",\n \"email\": \"guilherme@datacrazy.com.br\",\n \"source\": \"Google ads\",\n \"company\": \"Apple\",\n \"taxId\": \"108.154.702-92\",\n \"site\": \"www.meulead.com.br\",\n \"instagram\": \"@guilhermegavazzoni\",\n \"address\": {\n \"zip\": \"88338-130\",\n \"address\": \"Avenida Brasil\",\n \"block\": \"Centro\",\n \"city\": \"Balneário Camboriú\",\n \"state\": \"SC\",\n \"country\": \"BR\"\n },\n \"sourceReferral\": {\n \"sourceId\": \"2bc3d979-93a4-4e64-8903-5d9379d3de91\",\n \"sourceUrl\": \"https://example.com/artigo-de-origem\",\n \"ctwaId\": \"849fefab-e697-4720-9303-e788c23790cc\"\n },\n \"tags\": [\n {\n \"id\": [\n \"<string>\"\n ]\n }\n ],\n \"lists\": [\n {\n \"id\": [\n \"<string>\"\n ]\n }\n ],\n \"attendant\": {\n \"id\": \"<string>\"\n },\n \"notes\": {\n \"id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "15b41959-b04d-4a99-b878-6e45fffa7633",
"createdAt": "2025-06-11T18:31:25.203Z",
"name": "Guilherme Gavazzoni",
"image": "https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b",
"phone": "+55 (47) 991331190",
"rawPhone": "5547991331190",
"email": "guilherme@datacrazy.com.br",
"source": "Google ads",
"company": "Apple",
"taxId": "108.154.702-92",
"site": "www.meulead.com.br",
"instagram": "@guilhermegavazzoni",
"address": {
"zip": "88338-130",
"address": "Avenida Brasil",
"block": "Centro",
"city": "Balneário Camboriú",
"state": "SC",
"country": "BR"
},
"tags": {
"id": "849fefab-e697-4720-9303-e788c23790cc",
"name": "IA",
"color": "#DC2626",
"description": "Leads IA",
"createdAt": "2025-06-12T17:37:17.861Z"
},
"lists": [
{
"id": "5343afav-e697-4720-9303-e788c23711dd",
"name": "ativos",
"color": "#EB2626",
"description": "lista de compradores recorrentes",
"createdAt": "2025-06-12T17:37:17.861Z"
},
{
"id": "f2b3c92d-3843-406f-a3e3-672d2d7d2a27",
"name": "inativos",
"color": "#EB2626",
"description": "lista de compradores de baixa frequência",
"createdAt": "2025-12-03T17:28:09:5361Z"
}
],
"contacts": [
{
"platform": "EMAIL",
"contactId": "853b46db8ae664237d89dd6",
"lastContactStatus": null
},
{
"platform": "WHATSAPP",
"contactId": "555491664460",
"lastContactStatus": {
"platform": "WHATSAPP",
"contactId": "555491664460",
"instanceId": "681bb0510fe99d126e7c6b7b",
"isPending": true,
"lastReceivedMessage": {
"messageId": "684c13db8ae7797307d83cc3",
"date": "2025-06-13T12:04:48.218Z",
"errorCode": null
},
"lastSendedMessage": {
"messageId": "684c13c28ae7797307d83bc4",
"date": "2025-06-13T12:04:23.511Z",
"errorCode": null
}
}
}
],
"metrics": {
"purchaseCount": 1,
"lastPurchaseDate": "2025-06-04T19:34:55.535Z",
"averageTicket": 14040,
"totalSpent": 21080,
"openBusinessesCount": 4,
"lostBusinessesCount": 1,
"lostBusinessesTotalValue": 7800,
"purchaseFrequency": 3
},
"attendant": {
"userId": "86BshEbu5WY94ZOB8beUvk1y7tF2",
"id": "6cc8c79c-a0c8-4293-a4a0-d7e730aff7c7",
"name": "Joao da Silva",
"email": "joao@hotmail..com",
"phone": "554791331190"
},
"sourceReferral": {
"sourceId": "2bc3d979-93a4-4e64-8903-5d9379d3de91",
"sourceUrl": "https://example.com/artigo-de-origem",
"ctwaId": "849fefab-e697-4720-9303-e788c23790cc"
}
}Atualizar lead
curl --request PATCH \
--url https://api.g1.datacrazy.io/api/v1/leads/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Guilherme Gavazzoni",
"image": "https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b",
"phone": "+55 (47) 991331190",
"email": "guilherme@datacrazy.com.br",
"source": "Google ads",
"company": "Apple",
"taxId": "108.154.702-92",
"site": "www.meulead.com.br",
"instagram": "@guilhermegavazzoni",
"address": {
"zip": "88338-130",
"address": "Avenida Brasil",
"block": "Centro",
"city": "Balneário Camboriú",
"state": "SC",
"country": "BR"
},
"sourceReferral": {
"sourceId": "2bc3d979-93a4-4e64-8903-5d9379d3de91",
"sourceUrl": "https://example.com/artigo-de-origem",
"ctwaId": "849fefab-e697-4720-9303-e788c23790cc"
},
"tags": [
{
"id": [
"<string>"
]
}
],
"lists": [
{
"id": [
"<string>"
]
}
],
"attendant": {
"id": "<string>"
},
"notes": {
"id": "<string>"
}
}
'import requests
url = "https://api.g1.datacrazy.io/api/v1/leads/{id}"
payload = {
"name": "Guilherme Gavazzoni",
"image": "https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b",
"phone": "+55 (47) 991331190",
"email": "guilherme@datacrazy.com.br",
"source": "Google ads",
"company": "Apple",
"taxId": "108.154.702-92",
"site": "www.meulead.com.br",
"instagram": "@guilhermegavazzoni",
"address": {
"zip": "88338-130",
"address": "Avenida Brasil",
"block": "Centro",
"city": "Balneário Camboriú",
"state": "SC",
"country": "BR"
},
"sourceReferral": {
"sourceId": "2bc3d979-93a4-4e64-8903-5d9379d3de91",
"sourceUrl": "https://example.com/artigo-de-origem",
"ctwaId": "849fefab-e697-4720-9303-e788c23790cc"
},
"tags": [{ "id": ["<string>"] }],
"lists": [{ "id": ["<string>"] }],
"attendant": { "id": "<string>" },
"notes": { "id": "<string>" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Guilherme Gavazzoni',
image: 'https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b',
phone: '+55 (47) 991331190',
email: 'guilherme@datacrazy.com.br',
source: 'Google ads',
company: 'Apple',
taxId: '108.154.702-92',
site: 'www.meulead.com.br',
instagram: '@guilhermegavazzoni',
address: {
zip: '88338-130',
address: 'Avenida Brasil',
block: 'Centro',
city: 'Balneário Camboriú',
state: 'SC',
country: 'BR'
},
sourceReferral: {
sourceId: '2bc3d979-93a4-4e64-8903-5d9379d3de91',
sourceUrl: 'https://example.com/artigo-de-origem',
ctwaId: '849fefab-e697-4720-9303-e788c23790cc'
},
tags: [{id: ['<string>']}],
lists: [{id: ['<string>']}],
attendant: {id: '<string>'},
notes: {id: '<string>'}
})
};
fetch('https://api.g1.datacrazy.io/api/v1/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://api.g1.datacrazy.io/api/v1/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' => 'Guilherme Gavazzoni',
'image' => 'https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b',
'phone' => '+55 (47) 991331190',
'email' => 'guilherme@datacrazy.com.br',
'source' => 'Google ads',
'company' => 'Apple',
'taxId' => '108.154.702-92',
'site' => 'www.meulead.com.br',
'instagram' => '@guilhermegavazzoni',
'address' => [
'zip' => '88338-130',
'address' => 'Avenida Brasil',
'block' => 'Centro',
'city' => 'Balneário Camboriú',
'state' => 'SC',
'country' => 'BR'
],
'sourceReferral' => [
'sourceId' => '2bc3d979-93a4-4e64-8903-5d9379d3de91',
'sourceUrl' => 'https://example.com/artigo-de-origem',
'ctwaId' => '849fefab-e697-4720-9303-e788c23790cc'
],
'tags' => [
[
'id' => [
'<string>'
]
]
],
'lists' => [
[
'id' => [
'<string>'
]
]
],
'attendant' => [
'id' => '<string>'
],
'notes' => [
'id' => '<string>'
]
]),
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.g1.datacrazy.io/api/v1/leads/{id}"
payload := strings.NewReader("{\n \"name\": \"Guilherme Gavazzoni\",\n \"image\": \"https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b\",\n \"phone\": \"+55 (47) 991331190\",\n \"email\": \"guilherme@datacrazy.com.br\",\n \"source\": \"Google ads\",\n \"company\": \"Apple\",\n \"taxId\": \"108.154.702-92\",\n \"site\": \"www.meulead.com.br\",\n \"instagram\": \"@guilhermegavazzoni\",\n \"address\": {\n \"zip\": \"88338-130\",\n \"address\": \"Avenida Brasil\",\n \"block\": \"Centro\",\n \"city\": \"Balneário Camboriú\",\n \"state\": \"SC\",\n \"country\": \"BR\"\n },\n \"sourceReferral\": {\n \"sourceId\": \"2bc3d979-93a4-4e64-8903-5d9379d3de91\",\n \"sourceUrl\": \"https://example.com/artigo-de-origem\",\n \"ctwaId\": \"849fefab-e697-4720-9303-e788c23790cc\"\n },\n \"tags\": [\n {\n \"id\": [\n \"<string>\"\n ]\n }\n ],\n \"lists\": [\n {\n \"id\": [\n \"<string>\"\n ]\n }\n ],\n \"attendant\": {\n \"id\": \"<string>\"\n },\n \"notes\": {\n \"id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.g1.datacrazy.io/api/v1/leads/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Guilherme Gavazzoni\",\n \"image\": \"https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b\",\n \"phone\": \"+55 (47) 991331190\",\n \"email\": \"guilherme@datacrazy.com.br\",\n \"source\": \"Google ads\",\n \"company\": \"Apple\",\n \"taxId\": \"108.154.702-92\",\n \"site\": \"www.meulead.com.br\",\n \"instagram\": \"@guilhermegavazzoni\",\n \"address\": {\n \"zip\": \"88338-130\",\n \"address\": \"Avenida Brasil\",\n \"block\": \"Centro\",\n \"city\": \"Balneário Camboriú\",\n \"state\": \"SC\",\n \"country\": \"BR\"\n },\n \"sourceReferral\": {\n \"sourceId\": \"2bc3d979-93a4-4e64-8903-5d9379d3de91\",\n \"sourceUrl\": \"https://example.com/artigo-de-origem\",\n \"ctwaId\": \"849fefab-e697-4720-9303-e788c23790cc\"\n },\n \"tags\": [\n {\n \"id\": [\n \"<string>\"\n ]\n }\n ],\n \"lists\": [\n {\n \"id\": [\n \"<string>\"\n ]\n }\n ],\n \"attendant\": {\n \"id\": \"<string>\"\n },\n \"notes\": {\n \"id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.g1.datacrazy.io/api/v1/leads/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Guilherme Gavazzoni\",\n \"image\": \"https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b\",\n \"phone\": \"+55 (47) 991331190\",\n \"email\": \"guilherme@datacrazy.com.br\",\n \"source\": \"Google ads\",\n \"company\": \"Apple\",\n \"taxId\": \"108.154.702-92\",\n \"site\": \"www.meulead.com.br\",\n \"instagram\": \"@guilhermegavazzoni\",\n \"address\": {\n \"zip\": \"88338-130\",\n \"address\": \"Avenida Brasil\",\n \"block\": \"Centro\",\n \"city\": \"Balneário Camboriú\",\n \"state\": \"SC\",\n \"country\": \"BR\"\n },\n \"sourceReferral\": {\n \"sourceId\": \"2bc3d979-93a4-4e64-8903-5d9379d3de91\",\n \"sourceUrl\": \"https://example.com/artigo-de-origem\",\n \"ctwaId\": \"849fefab-e697-4720-9303-e788c23790cc\"\n },\n \"tags\": [\n {\n \"id\": [\n \"<string>\"\n ]\n }\n ],\n \"lists\": [\n {\n \"id\": [\n \"<string>\"\n ]\n }\n ],\n \"attendant\": {\n \"id\": \"<string>\"\n },\n \"notes\": {\n \"id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "15b41959-b04d-4a99-b878-6e45fffa7633",
"createdAt": "2025-06-11T18:31:25.203Z",
"name": "Guilherme Gavazzoni",
"image": "https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b",
"phone": "+55 (47) 991331190",
"rawPhone": "5547991331190",
"email": "guilherme@datacrazy.com.br",
"source": "Google ads",
"company": "Apple",
"taxId": "108.154.702-92",
"site": "www.meulead.com.br",
"instagram": "@guilhermegavazzoni",
"address": {
"zip": "88338-130",
"address": "Avenida Brasil",
"block": "Centro",
"city": "Balneário Camboriú",
"state": "SC",
"country": "BR"
},
"tags": {
"id": "849fefab-e697-4720-9303-e788c23790cc",
"name": "IA",
"color": "#DC2626",
"description": "Leads IA",
"createdAt": "2025-06-12T17:37:17.861Z"
},
"lists": [
{
"id": "5343afav-e697-4720-9303-e788c23711dd",
"name": "ativos",
"color": "#EB2626",
"description": "lista de compradores recorrentes",
"createdAt": "2025-06-12T17:37:17.861Z"
},
{
"id": "f2b3c92d-3843-406f-a3e3-672d2d7d2a27",
"name": "inativos",
"color": "#EB2626",
"description": "lista de compradores de baixa frequência",
"createdAt": "2025-12-03T17:28:09:5361Z"
}
],
"contacts": [
{
"platform": "EMAIL",
"contactId": "853b46db8ae664237d89dd6",
"lastContactStatus": null
},
{
"platform": "WHATSAPP",
"contactId": "555491664460",
"lastContactStatus": {
"platform": "WHATSAPP",
"contactId": "555491664460",
"instanceId": "681bb0510fe99d126e7c6b7b",
"isPending": true,
"lastReceivedMessage": {
"messageId": "684c13db8ae7797307d83cc3",
"date": "2025-06-13T12:04:48.218Z",
"errorCode": null
},
"lastSendedMessage": {
"messageId": "684c13c28ae7797307d83bc4",
"date": "2025-06-13T12:04:23.511Z",
"errorCode": null
}
}
}
],
"metrics": {
"purchaseCount": 1,
"lastPurchaseDate": "2025-06-04T19:34:55.535Z",
"averageTicket": 14040,
"totalSpent": 21080,
"openBusinessesCount": 4,
"lostBusinessesCount": 1,
"lostBusinessesTotalValue": 7800,
"purchaseFrequency": 3
},
"attendant": {
"userId": "86BshEbu5WY94ZOB8beUvk1y7tF2",
"id": "6cc8c79c-a0c8-4293-a4a0-d7e730aff7c7",
"name": "Joao da Silva",
"email": "joao@hotmail..com",
"phone": "554791331190"
},
"sourceReferral": {
"sourceId": "2bc3d979-93a4-4e64-8903-5d9379d3de91",
"sourceUrl": "https://example.com/artigo-de-origem",
"ctwaId": "849fefab-e697-4720-9303-e788c23790cc"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Array de ID de tags
"Guilherme Gavazzoni"
Url da Imagem do lead
"https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b"
Telefone do lead
"+55 (47) 991331190"
Email do lead
"guilherme@datacrazy.com.br"
Origem do lead
"Google ads"
Empresa do lead
"Apple"
Documento de identificação
"108.154.702-92"
Site do lead
"www.meulead.com.br"
Instagram do lead
"@guilhermegavazzoni"
Endereço vinculado ao lead
Show child attributes
Show child attributes
{
"zip": "88338-130",
"address": "Avenida Brasil",
"block": "Centro",
"city": "Balneário Camboriú",
"state": "SC",
"country": "BR"
}
Fonte de referencia do lead
Show child attributes
Show child attributes
Array de ID de tags
Show child attributes
Show child attributes
Array de ID de listas
Show child attributes
Show child attributes
ID do atendente
Show child attributes
Show child attributes
Notas
Show child attributes
Show child attributes
Response
Id do lead
"15b41959-b04d-4a99-b878-6e45fffa7633"
Data de criação do lead
"2025-06-11T18:31:25.203Z"
Nome do lead
"Guilherme Gavazzoni"
Url da Imagem do lead
"https://dc-qqqq2222pb.s3.amazonaws.com/0a7ac87c-2f50-46b5-9c39-80ffec53e633/1163f5c2-62f4-443f-a84f-9c223b05ae3b"
Telefone do lead
"+55 (47) 991331190"
Telefone do lead (apenas números)
"5547991331190"
Email do lead
"guilherme@datacrazy.com.br"
Origem do lead
"Google ads"
Empresa do lead
"Apple"
Documento de identificação
"108.154.702-92"
Site do lead
"www.meulead.com.br"
Instagram do lead
"@guilhermegavazzoni"
Endereço vinculado ao lead
Show child attributes
Show child attributes
{
"zip": "88338-130",
"address": "Avenida Brasil",
"block": "Centro",
"city": "Balneário Camboriú",
"state": "SC",
"country": "BR"
}
ID das tags atreladas ao lead
Show child attributes
Show child attributes
{
"id": "849fefab-e697-4720-9303-e788c23790cc",
"name": "IA",
"color": "#DC2626",
"description": "Leads IA",
"createdAt": "2025-06-12T17:37:17.861Z"
}
Array de listas atreladas ao lead
[
{
"id": "5343afav-e697-4720-9303-e788c23711dd",
"name": "ativos",
"color": "#EB2626",
"description": "lista de compradores recorrentes",
"createdAt": "2025-06-12T17:37:17.861Z"
},
{
"id": "f2b3c92d-3843-406f-a3e3-672d2d7d2a27",
"name": "inativos",
"color": "#EB2626",
"description": "lista de compradores de baixa frequência",
"createdAt": "2025-12-03T17:28:09:5361Z"
}
]
Array de contatos atrelados ao lead
[
{
"platform": "EMAIL",
"contactId": "853b46db8ae664237d89dd6",
"lastContactStatus": null
},
{
"platform": "WHATSAPP",
"contactId": "555491664460",
"lastContactStatus": {
"platform": "WHATSAPP",
"contactId": "555491664460",
"instanceId": "681bb0510fe99d126e7c6b7b",
"isPending": true,
"lastReceivedMessage": {
"messageId": "684c13db8ae7797307d83cc3",
"date": "2025-06-13T12:04:48.218Z",
"errorCode": null
},
"lastSendedMessage": {
"messageId": "684c13c28ae7797307d83bc4",
"date": "2025-06-13T12:04:23.511Z",
"errorCode": null
}
}
}
]
Métricas referentes ao lead
Show child attributes
Show child attributes
{
"purchaseCount": 1,
"lastPurchaseDate": "2025-06-04T19:34:55.535Z",
"averageTicket": 14040,
"totalSpent": 21080,
"openBusinessesCount": 4,
"lostBusinessesCount": 1,
"lostBusinessesTotalValue": 7800,
"purchaseFrequency": 3
}
Atual atendente do lead
Show child attributes
Show child attributes
{
"userId": "86BshEbu5WY94ZOB8beUvk1y7tF2",
"id": "6cc8c79c-a0c8-4293-a4a0-d7e730aff7c7",
"name": "Joao da Silva",
"email": "joao@hotmail..com",
"phone": "554791331190"
}
Fonte de referencia do lead
Show child attributes
Show child attributes