curl --request POST \
--url https://api.g1.datacrazy.io/api/v1/leads/additional-fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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",
"birthDate": "2000-01-01T00:00:00.000Z",
"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"
},
"additionalFields": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"type": "<string>",
"entity": "<string>",
"isPublic": "<string>",
"options": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://api.g1.datacrazy.io/api/v1/leads/additional-fields"
payload = {
"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",
"birthDate": "2000-01-01T00:00:00.000Z",
"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": None
},
{
"platform": "WHATSAPP",
"contactId": "555491664460",
"lastContactStatus": {
"platform": "WHATSAPP",
"contactId": "555491664460",
"instanceId": "681bb0510fe99d126e7c6b7b",
"isPending": True,
"lastReceivedMessage": {
"messageId": "684c13db8ae7797307d83cc3",
"date": "2025-06-13T12:04:48.218Z",
"errorCode": None
},
"lastSendedMessage": {
"messageId": "684c13c28ae7797307d83bc4",
"date": "2025-06-13T12:04:23.511Z",
"errorCode": None
}
}
}
],
"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"
},
"additionalFields": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"type": "<string>",
"entity": "<string>",
"isPublic": "<string>",
"options": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
}
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({
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',
birthDate: '2000-01-01T00:00:00.000Z',
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'
},
additionalFields: {
id: '<string>',
name: '<string>',
description: '<string>',
type: '<string>',
entity: '<string>',
isPublic: '<string>',
options: '<string>',
createdAt: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://api.g1.datacrazy.io/api/v1/leads/additional-fields', 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/additional-fields",
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([
'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',
'birthDate' => '2000-01-01T00:00:00.000Z',
'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'
],
'additionalFields' => [
'id' => '<string>',
'name' => '<string>',
'description' => '<string>',
'type' => '<string>',
'entity' => '<string>',
'isPublic' => '<string>',
'options' => '<string>',
'createdAt' => '2023-11-07T05:31:56Z'
]
]),
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/additional-fields"
payload := strings.NewReader("{\n \"id\": \"15b41959-b04d-4a99-b878-6e45fffa7633\",\n \"createdAt\": \"2025-06-11T18:31:25.203Z\",\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 \"rawPhone\": \"5547991331190\",\n \"email\": \"guilherme@datacrazy.com.br\",\n \"source\": \"Google ads\",\n \"company\": \"Apple\",\n \"birthDate\": \"2000-01-01T00:00:00.000Z\",\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 \"tags\": {\n \"id\": \"849fefab-e697-4720-9303-e788c23790cc\",\n \"name\": \"IA\",\n \"color\": \"#DC2626\",\n \"description\": \"Leads IA\",\n \"createdAt\": \"2025-06-12T17:37:17.861Z\"\n },\n \"lists\": [\n {\n \"id\": \"5343afav-e697-4720-9303-e788c23711dd\",\n \"name\": \"ativos\",\n \"color\": \"#EB2626\",\n \"description\": \"lista de compradores recorrentes\",\n \"createdAt\": \"2025-06-12T17:37:17.861Z\"\n },\n {\n \"id\": \"f2b3c92d-3843-406f-a3e3-672d2d7d2a27\",\n \"name\": \"inativos\",\n \"color\": \"#EB2626\",\n \"description\": \"lista de compradores de baixa frequência\",\n \"createdAt\": \"2025-12-03T17:28:09:5361Z\"\n }\n ],\n \"contacts\": [\n {\n \"platform\": \"EMAIL\",\n \"contactId\": \"853b46db8ae664237d89dd6\",\n \"lastContactStatus\": null\n },\n {\n \"platform\": \"WHATSAPP\",\n \"contactId\": \"555491664460\",\n \"lastContactStatus\": {\n \"platform\": \"WHATSAPP\",\n \"contactId\": \"555491664460\",\n \"instanceId\": \"681bb0510fe99d126e7c6b7b\",\n \"isPending\": true,\n \"lastReceivedMessage\": {\n \"messageId\": \"684c13db8ae7797307d83cc3\",\n \"date\": \"2025-06-13T12:04:48.218Z\",\n \"errorCode\": null\n },\n \"lastSendedMessage\": {\n \"messageId\": \"684c13c28ae7797307d83bc4\",\n \"date\": \"2025-06-13T12:04:23.511Z\",\n \"errorCode\": null\n }\n }\n }\n ],\n \"metrics\": {\n \"purchaseCount\": 1,\n \"lastPurchaseDate\": \"2025-06-04T19:34:55.535Z\",\n \"averageTicket\": 14040,\n \"totalSpent\": 21080,\n \"openBusinessesCount\": 4,\n \"lostBusinessesCount\": 1,\n \"lostBusinessesTotalValue\": 7800,\n \"purchaseFrequency\": 3\n },\n \"attendant\": {\n \"userId\": \"86BshEbu5WY94ZOB8beUvk1y7tF2\",\n \"id\": \"6cc8c79c-a0c8-4293-a4a0-d7e730aff7c7\",\n \"name\": \"Joao da Silva\",\n \"email\": \"joao@hotmail..com\",\n \"phone\": \"554791331190\"\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 \"additionalFields\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"type\": \"<string>\",\n \"entity\": \"<string>\",\n \"isPublic\": \"<string>\",\n \"options\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\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.g1.datacrazy.io/api/v1/leads/additional-fields")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"15b41959-b04d-4a99-b878-6e45fffa7633\",\n \"createdAt\": \"2025-06-11T18:31:25.203Z\",\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 \"rawPhone\": \"5547991331190\",\n \"email\": \"guilherme@datacrazy.com.br\",\n \"source\": \"Google ads\",\n \"company\": \"Apple\",\n \"birthDate\": \"2000-01-01T00:00:00.000Z\",\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 \"tags\": {\n \"id\": \"849fefab-e697-4720-9303-e788c23790cc\",\n \"name\": \"IA\",\n \"color\": \"#DC2626\",\n \"description\": \"Leads IA\",\n \"createdAt\": \"2025-06-12T17:37:17.861Z\"\n },\n \"lists\": [\n {\n \"id\": \"5343afav-e697-4720-9303-e788c23711dd\",\n \"name\": \"ativos\",\n \"color\": \"#EB2626\",\n \"description\": \"lista de compradores recorrentes\",\n \"createdAt\": \"2025-06-12T17:37:17.861Z\"\n },\n {\n \"id\": \"f2b3c92d-3843-406f-a3e3-672d2d7d2a27\",\n \"name\": \"inativos\",\n \"color\": \"#EB2626\",\n \"description\": \"lista de compradores de baixa frequência\",\n \"createdAt\": \"2025-12-03T17:28:09:5361Z\"\n }\n ],\n \"contacts\": [\n {\n \"platform\": \"EMAIL\",\n \"contactId\": \"853b46db8ae664237d89dd6\",\n \"lastContactStatus\": null\n },\n {\n \"platform\": \"WHATSAPP\",\n \"contactId\": \"555491664460\",\n \"lastContactStatus\": {\n \"platform\": \"WHATSAPP\",\n \"contactId\": \"555491664460\",\n \"instanceId\": \"681bb0510fe99d126e7c6b7b\",\n \"isPending\": true,\n \"lastReceivedMessage\": {\n \"messageId\": \"684c13db8ae7797307d83cc3\",\n \"date\": \"2025-06-13T12:04:48.218Z\",\n \"errorCode\": null\n },\n \"lastSendedMessage\": {\n \"messageId\": \"684c13c28ae7797307d83bc4\",\n \"date\": \"2025-06-13T12:04:23.511Z\",\n \"errorCode\": null\n }\n }\n }\n ],\n \"metrics\": {\n \"purchaseCount\": 1,\n \"lastPurchaseDate\": \"2025-06-04T19:34:55.535Z\",\n \"averageTicket\": 14040,\n \"totalSpent\": 21080,\n \"openBusinessesCount\": 4,\n \"lostBusinessesCount\": 1,\n \"lostBusinessesTotalValue\": 7800,\n \"purchaseFrequency\": 3\n },\n \"attendant\": {\n \"userId\": \"86BshEbu5WY94ZOB8beUvk1y7tF2\",\n \"id\": \"6cc8c79c-a0c8-4293-a4a0-d7e730aff7c7\",\n \"name\": \"Joao da Silva\",\n \"email\": \"joao@hotmail..com\",\n \"phone\": \"554791331190\"\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 \"additionalFields\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"type\": \"<string>\",\n \"entity\": \"<string>\",\n \"isPublic\": \"<string>\",\n \"options\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.g1.datacrazy.io/api/v1/leads/additional-fields")
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 \"id\": \"15b41959-b04d-4a99-b878-6e45fffa7633\",\n \"createdAt\": \"2025-06-11T18:31:25.203Z\",\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 \"rawPhone\": \"5547991331190\",\n \"email\": \"guilherme@datacrazy.com.br\",\n \"source\": \"Google ads\",\n \"company\": \"Apple\",\n \"birthDate\": \"2000-01-01T00:00:00.000Z\",\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 \"tags\": {\n \"id\": \"849fefab-e697-4720-9303-e788c23790cc\",\n \"name\": \"IA\",\n \"color\": \"#DC2626\",\n \"description\": \"Leads IA\",\n \"createdAt\": \"2025-06-12T17:37:17.861Z\"\n },\n \"lists\": [\n {\n \"id\": \"5343afav-e697-4720-9303-e788c23711dd\",\n \"name\": \"ativos\",\n \"color\": \"#EB2626\",\n \"description\": \"lista de compradores recorrentes\",\n \"createdAt\": \"2025-06-12T17:37:17.861Z\"\n },\n {\n \"id\": \"f2b3c92d-3843-406f-a3e3-672d2d7d2a27\",\n \"name\": \"inativos\",\n \"color\": \"#EB2626\",\n \"description\": \"lista de compradores de baixa frequência\",\n \"createdAt\": \"2025-12-03T17:28:09:5361Z\"\n }\n ],\n \"contacts\": [\n {\n \"platform\": \"EMAIL\",\n \"contactId\": \"853b46db8ae664237d89dd6\",\n \"lastContactStatus\": null\n },\n {\n \"platform\": \"WHATSAPP\",\n \"contactId\": \"555491664460\",\n \"lastContactStatus\": {\n \"platform\": \"WHATSAPP\",\n \"contactId\": \"555491664460\",\n \"instanceId\": \"681bb0510fe99d126e7c6b7b\",\n \"isPending\": true,\n \"lastReceivedMessage\": {\n \"messageId\": \"684c13db8ae7797307d83cc3\",\n \"date\": \"2025-06-13T12:04:48.218Z\",\n \"errorCode\": null\n },\n \"lastSendedMessage\": {\n \"messageId\": \"684c13c28ae7797307d83bc4\",\n \"date\": \"2025-06-13T12:04:23.511Z\",\n \"errorCode\": null\n }\n }\n }\n ],\n \"metrics\": {\n \"purchaseCount\": 1,\n \"lastPurchaseDate\": \"2025-06-04T19:34:55.535Z\",\n \"averageTicket\": 14040,\n \"totalSpent\": 21080,\n \"openBusinessesCount\": 4,\n \"lostBusinessesCount\": 1,\n \"lostBusinessesTotalValue\": 7800,\n \"purchaseFrequency\": 3\n },\n \"attendant\": {\n \"userId\": \"86BshEbu5WY94ZOB8beUvk1y7tF2\",\n \"id\": \"6cc8c79c-a0c8-4293-a4a0-d7e730aff7c7\",\n \"name\": \"Joao da Silva\",\n \"email\": \"joao@hotmail..com\",\n \"phone\": \"554791331190\"\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 \"additionalFields\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"type\": \"<string>\",\n \"entity\": \"<string>\",\n \"isPublic\": \"<string>\",\n \"options\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_bodyCriar lead com campos adicionais
Cadastrar um novo lead com campos adicionais
curl --request POST \
--url https://api.g1.datacrazy.io/api/v1/leads/additional-fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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",
"birthDate": "2000-01-01T00:00:00.000Z",
"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"
},
"additionalFields": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"type": "<string>",
"entity": "<string>",
"isPublic": "<string>",
"options": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://api.g1.datacrazy.io/api/v1/leads/additional-fields"
payload = {
"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",
"birthDate": "2000-01-01T00:00:00.000Z",
"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": None
},
{
"platform": "WHATSAPP",
"contactId": "555491664460",
"lastContactStatus": {
"platform": "WHATSAPP",
"contactId": "555491664460",
"instanceId": "681bb0510fe99d126e7c6b7b",
"isPending": True,
"lastReceivedMessage": {
"messageId": "684c13db8ae7797307d83cc3",
"date": "2025-06-13T12:04:48.218Z",
"errorCode": None
},
"lastSendedMessage": {
"messageId": "684c13c28ae7797307d83bc4",
"date": "2025-06-13T12:04:23.511Z",
"errorCode": None
}
}
}
],
"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"
},
"additionalFields": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"type": "<string>",
"entity": "<string>",
"isPublic": "<string>",
"options": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
}
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({
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',
birthDate: '2000-01-01T00:00:00.000Z',
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'
},
additionalFields: {
id: '<string>',
name: '<string>',
description: '<string>',
type: '<string>',
entity: '<string>',
isPublic: '<string>',
options: '<string>',
createdAt: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://api.g1.datacrazy.io/api/v1/leads/additional-fields', 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/additional-fields",
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([
'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',
'birthDate' => '2000-01-01T00:00:00.000Z',
'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'
],
'additionalFields' => [
'id' => '<string>',
'name' => '<string>',
'description' => '<string>',
'type' => '<string>',
'entity' => '<string>',
'isPublic' => '<string>',
'options' => '<string>',
'createdAt' => '2023-11-07T05:31:56Z'
]
]),
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/additional-fields"
payload := strings.NewReader("{\n \"id\": \"15b41959-b04d-4a99-b878-6e45fffa7633\",\n \"createdAt\": \"2025-06-11T18:31:25.203Z\",\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 \"rawPhone\": \"5547991331190\",\n \"email\": \"guilherme@datacrazy.com.br\",\n \"source\": \"Google ads\",\n \"company\": \"Apple\",\n \"birthDate\": \"2000-01-01T00:00:00.000Z\",\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 \"tags\": {\n \"id\": \"849fefab-e697-4720-9303-e788c23790cc\",\n \"name\": \"IA\",\n \"color\": \"#DC2626\",\n \"description\": \"Leads IA\",\n \"createdAt\": \"2025-06-12T17:37:17.861Z\"\n },\n \"lists\": [\n {\n \"id\": \"5343afav-e697-4720-9303-e788c23711dd\",\n \"name\": \"ativos\",\n \"color\": \"#EB2626\",\n \"description\": \"lista de compradores recorrentes\",\n \"createdAt\": \"2025-06-12T17:37:17.861Z\"\n },\n {\n \"id\": \"f2b3c92d-3843-406f-a3e3-672d2d7d2a27\",\n \"name\": \"inativos\",\n \"color\": \"#EB2626\",\n \"description\": \"lista de compradores de baixa frequência\",\n \"createdAt\": \"2025-12-03T17:28:09:5361Z\"\n }\n ],\n \"contacts\": [\n {\n \"platform\": \"EMAIL\",\n \"contactId\": \"853b46db8ae664237d89dd6\",\n \"lastContactStatus\": null\n },\n {\n \"platform\": \"WHATSAPP\",\n \"contactId\": \"555491664460\",\n \"lastContactStatus\": {\n \"platform\": \"WHATSAPP\",\n \"contactId\": \"555491664460\",\n \"instanceId\": \"681bb0510fe99d126e7c6b7b\",\n \"isPending\": true,\n \"lastReceivedMessage\": {\n \"messageId\": \"684c13db8ae7797307d83cc3\",\n \"date\": \"2025-06-13T12:04:48.218Z\",\n \"errorCode\": null\n },\n \"lastSendedMessage\": {\n \"messageId\": \"684c13c28ae7797307d83bc4\",\n \"date\": \"2025-06-13T12:04:23.511Z\",\n \"errorCode\": null\n }\n }\n }\n ],\n \"metrics\": {\n \"purchaseCount\": 1,\n \"lastPurchaseDate\": \"2025-06-04T19:34:55.535Z\",\n \"averageTicket\": 14040,\n \"totalSpent\": 21080,\n \"openBusinessesCount\": 4,\n \"lostBusinessesCount\": 1,\n \"lostBusinessesTotalValue\": 7800,\n \"purchaseFrequency\": 3\n },\n \"attendant\": {\n \"userId\": \"86BshEbu5WY94ZOB8beUvk1y7tF2\",\n \"id\": \"6cc8c79c-a0c8-4293-a4a0-d7e730aff7c7\",\n \"name\": \"Joao da Silva\",\n \"email\": \"joao@hotmail..com\",\n \"phone\": \"554791331190\"\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 \"additionalFields\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"type\": \"<string>\",\n \"entity\": \"<string>\",\n \"isPublic\": \"<string>\",\n \"options\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\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.g1.datacrazy.io/api/v1/leads/additional-fields")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"15b41959-b04d-4a99-b878-6e45fffa7633\",\n \"createdAt\": \"2025-06-11T18:31:25.203Z\",\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 \"rawPhone\": \"5547991331190\",\n \"email\": \"guilherme@datacrazy.com.br\",\n \"source\": \"Google ads\",\n \"company\": \"Apple\",\n \"birthDate\": \"2000-01-01T00:00:00.000Z\",\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 \"tags\": {\n \"id\": \"849fefab-e697-4720-9303-e788c23790cc\",\n \"name\": \"IA\",\n \"color\": \"#DC2626\",\n \"description\": \"Leads IA\",\n \"createdAt\": \"2025-06-12T17:37:17.861Z\"\n },\n \"lists\": [\n {\n \"id\": \"5343afav-e697-4720-9303-e788c23711dd\",\n \"name\": \"ativos\",\n \"color\": \"#EB2626\",\n \"description\": \"lista de compradores recorrentes\",\n \"createdAt\": \"2025-06-12T17:37:17.861Z\"\n },\n {\n \"id\": \"f2b3c92d-3843-406f-a3e3-672d2d7d2a27\",\n \"name\": \"inativos\",\n \"color\": \"#EB2626\",\n \"description\": \"lista de compradores de baixa frequência\",\n \"createdAt\": \"2025-12-03T17:28:09:5361Z\"\n }\n ],\n \"contacts\": [\n {\n \"platform\": \"EMAIL\",\n \"contactId\": \"853b46db8ae664237d89dd6\",\n \"lastContactStatus\": null\n },\n {\n \"platform\": \"WHATSAPP\",\n \"contactId\": \"555491664460\",\n \"lastContactStatus\": {\n \"platform\": \"WHATSAPP\",\n \"contactId\": \"555491664460\",\n \"instanceId\": \"681bb0510fe99d126e7c6b7b\",\n \"isPending\": true,\n \"lastReceivedMessage\": {\n \"messageId\": \"684c13db8ae7797307d83cc3\",\n \"date\": \"2025-06-13T12:04:48.218Z\",\n \"errorCode\": null\n },\n \"lastSendedMessage\": {\n \"messageId\": \"684c13c28ae7797307d83bc4\",\n \"date\": \"2025-06-13T12:04:23.511Z\",\n \"errorCode\": null\n }\n }\n }\n ],\n \"metrics\": {\n \"purchaseCount\": 1,\n \"lastPurchaseDate\": \"2025-06-04T19:34:55.535Z\",\n \"averageTicket\": 14040,\n \"totalSpent\": 21080,\n \"openBusinessesCount\": 4,\n \"lostBusinessesCount\": 1,\n \"lostBusinessesTotalValue\": 7800,\n \"purchaseFrequency\": 3\n },\n \"attendant\": {\n \"userId\": \"86BshEbu5WY94ZOB8beUvk1y7tF2\",\n \"id\": \"6cc8c79c-a0c8-4293-a4a0-d7e730aff7c7\",\n \"name\": \"Joao da Silva\",\n \"email\": \"joao@hotmail..com\",\n \"phone\": \"554791331190\"\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 \"additionalFields\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"type\": \"<string>\",\n \"entity\": \"<string>\",\n \"isPublic\": \"<string>\",\n \"options\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.g1.datacrazy.io/api/v1/leads/additional-fields")
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 \"id\": \"15b41959-b04d-4a99-b878-6e45fffa7633\",\n \"createdAt\": \"2025-06-11T18:31:25.203Z\",\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 \"rawPhone\": \"5547991331190\",\n \"email\": \"guilherme@datacrazy.com.br\",\n \"source\": \"Google ads\",\n \"company\": \"Apple\",\n \"birthDate\": \"2000-01-01T00:00:00.000Z\",\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 \"tags\": {\n \"id\": \"849fefab-e697-4720-9303-e788c23790cc\",\n \"name\": \"IA\",\n \"color\": \"#DC2626\",\n \"description\": \"Leads IA\",\n \"createdAt\": \"2025-06-12T17:37:17.861Z\"\n },\n \"lists\": [\n {\n \"id\": \"5343afav-e697-4720-9303-e788c23711dd\",\n \"name\": \"ativos\",\n \"color\": \"#EB2626\",\n \"description\": \"lista de compradores recorrentes\",\n \"createdAt\": \"2025-06-12T17:37:17.861Z\"\n },\n {\n \"id\": \"f2b3c92d-3843-406f-a3e3-672d2d7d2a27\",\n \"name\": \"inativos\",\n \"color\": \"#EB2626\",\n \"description\": \"lista de compradores de baixa frequência\",\n \"createdAt\": \"2025-12-03T17:28:09:5361Z\"\n }\n ],\n \"contacts\": [\n {\n \"platform\": \"EMAIL\",\n \"contactId\": \"853b46db8ae664237d89dd6\",\n \"lastContactStatus\": null\n },\n {\n \"platform\": \"WHATSAPP\",\n \"contactId\": \"555491664460\",\n \"lastContactStatus\": {\n \"platform\": \"WHATSAPP\",\n \"contactId\": \"555491664460\",\n \"instanceId\": \"681bb0510fe99d126e7c6b7b\",\n \"isPending\": true,\n \"lastReceivedMessage\": {\n \"messageId\": \"684c13db8ae7797307d83cc3\",\n \"date\": \"2025-06-13T12:04:48.218Z\",\n \"errorCode\": null\n },\n \"lastSendedMessage\": {\n \"messageId\": \"684c13c28ae7797307d83bc4\",\n \"date\": \"2025-06-13T12:04:23.511Z\",\n \"errorCode\": null\n }\n }\n }\n ],\n \"metrics\": {\n \"purchaseCount\": 1,\n \"lastPurchaseDate\": \"2025-06-04T19:34:55.535Z\",\n \"averageTicket\": 14040,\n \"totalSpent\": 21080,\n \"openBusinessesCount\": 4,\n \"lostBusinessesCount\": 1,\n \"lostBusinessesTotalValue\": 7800,\n \"purchaseFrequency\": 3\n },\n \"attendant\": {\n \"userId\": \"86BshEbu5WY94ZOB8beUvk1y7tF2\",\n \"id\": \"6cc8c79c-a0c8-4293-a4a0-d7e730aff7c7\",\n \"name\": \"Joao da Silva\",\n \"email\": \"joao@hotmail..com\",\n \"phone\": \"554791331190\"\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 \"additionalFields\": {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"type\": \"<string>\",\n \"entity\": \"<string>\",\n \"isPublic\": \"<string>\",\n \"options\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
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"
Data de nascimento do lead
"2000-01-01T00:00:00.000Z"
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
Campos adicionais do lead
Show child attributes
Show child attributes