curl --request GET \
--url https://api.wegly.com.br/integrations/external/leads/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.wegly.com.br/integrations/external/leads/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wegly.com.br/integrations/external/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.wegly.com.br/integrations/external/leads/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wegly.com.br/integrations/external/leads/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wegly.com.br/integrations/external/leads/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wegly.com.br/integrations/external/leads/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"code": 123,
"title": "<string>",
"measurement_consent": "GRANTED",
"created_by": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"stage": {
"id": "<string>",
"name": "<string>",
"pipeline": {
"id": "<string>",
"name": "<string>"
}
},
"pipeline_stages": [
{
"id": "<string>",
"name": "<string>",
"position": 123
}
],
"responsible": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"lead_source": {
"id": "<string>",
"name": "<string>",
"logo": "<string>"
},
"marketing_lead_source": {
"id": "<string>",
"utm_search_term": "<string>",
"utm_medium": "<string>",
"lead_source": {
"id": "<string>",
"name": "<string>",
"logo": "<string>"
},
"url_conversion": "<string>",
"campaing_name": "<string>",
"ad_set_name": "<string>",
"content_name": "<string>",
"displayed_on_name": "<string>",
"conversion_tool_name": "<string>",
"creative": {
"id": "<string>",
"value": "<string>",
"creative_uri": "<string>"
},
"source_url": "<string>",
"headline": "<string>",
"ad_body": "<string>",
"media_type": "<string>",
"ads_clid_id": "<string>",
"gclid": "<string>",
"fbclid": "<string>",
"fbc": "<string>",
"fbp": "<string>",
"conversion_url_full": "<string>",
"measurement_consent": "GRANTED"
},
"quality_rating": 123,
"quality_reason": "<string>",
"won_date": "2023-11-07T05:31:56Z",
"lost_date": "2023-11-07T05:31:56Z",
"crm_loss_reason": {
"id": "<string>",
"name": "<string>"
},
"lost_reason_description": "<string>",
"visibility": 0,
"negotiation_mode": 123,
"created_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"last_activity_at": "2023-11-07T05:31:56Z",
"participants": [
{
"id": "<string>",
"main": true,
"role": "<string>",
"notes": "<string>",
"person": {
"id": "<string>",
"name": "<string>",
"contacts": [
{
"id": "<string>",
"type": 0,
"value": "<string>",
"primary": true
}
]
}
}
],
"organization": {
"id": "<string>",
"name": "<string>",
"logo": "<string>"
},
"custom_fields": [
{
"field_id": "<string>",
"field_name": "<string>",
"field_type": 123,
"answers": [
{
"id": "<string>",
"option_id": "<string>",
"option_value": "<string>",
"value": "<string>"
}
]
}
],
"tags": [
{
"id": "<string>",
"name": "<string>",
"color": {
"background": "<string>",
"foreground": "<string>"
}
}
],
"stage_durations": [
{
"stage_id": "<string>",
"stage_name": "<string>",
"total_seconds": 123,
"human_readable": "<string>"
}
],
"value": 123,
"views_count": 123,
"associations_count": {
"items": 123,
"tasks": 123,
"qualifications": 123,
"notes": 123,
"files": 123,
"activities": 123,
"proposals": 123,
"deals": 123
},
"proposals": [
{
"id": "<string>",
"code": 123,
"version": 123,
"title": "<string>",
"status": 123,
"is_primary": true,
"discount_type": 123,
"discount_value": 123,
"subtotal": 123,
"total": 123,
"valid_until": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"approved_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"rejected_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"approved_by": {
"id": "<string>",
"name": "<string>"
}
}
],
"followers": [
{
"role": {
"id": "<string>",
"name": "<string>"
},
"user": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"notes": "<string>"
}
],
"icp": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"banner_type": "<string>",
"banner_image_url": "<string>",
"banner_color": "<string>",
"gradient_start_color": "<string>",
"gradient_end_color": "<string>",
"gradient_angle": 123
},
"icps": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"banner_type": "<string>",
"banner_image_url": "<string>",
"banner_color": "<string>",
"gradient_start_color": "<string>",
"gradient_end_color": "<string>",
"gradient_angle": 123,
"is_primary": true
}
],
"partners": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": 123,
"name": "<string>",
"trade_name": "<string>",
"logo": "<string>",
"documents": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": 123,
"value": "<string>",
"label": "<string>",
"is_primary": true
}
],
"address": {
"city": "<string>",
"state": "<string>",
"country": "<string>",
"zip_code": "<string>",
"street": "<string>",
"number": "<string>",
"complement": "<string>",
"neighborhood": "<string>",
"formatted_address": "<string>",
"latitude": 123,
"longitude": 123
}
}
],
"has_channel_chat": true,
"channel_chats": [
{
"chat_id": "<string>",
"title": "<string>",
"person_id": "<string>",
"person_name": "<string>",
"channel_account_id": "<string>",
"type": "WhatsApp",
"channel_type": "WHATSAPP",
"unread_count": 123,
"channel_account_name": "<string>",
"whatsapp_number_verified_name": "<string>",
"external_contact_id": "<string>",
"external_contact_handle": "<string>",
"chat_responsible": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
}
],
"has_whatsapp_chat": true,
"whatsapp_chats": [
{
"chat_id": "<string>",
"title": "<string>",
"person_id": "<string>",
"person_name": "<string>",
"channel_account_id": "<string>",
"type": "WhatsApp",
"channel_type": "WHATSAPP",
"unread_count": 123,
"channel_account_name": "<string>",
"whatsapp_number_verified_name": "<string>",
"external_contact_id": "<string>",
"external_contact_handle": "<string>",
"chat_responsible": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
}
],
"score": 123,
"score_criteria_count": 123,
"score_updated_at": "2023-11-07T05:31:56Z",
"valuation": {
"mode": "CURRENT",
"source": "LEGACY_CURRENT_VALUE",
"current_value": 123,
"projected_value": 123,
"display_value": 123,
"has_recurring_value": true,
"has_indefinite_recurring_value": true,
"has_rolling_projection": true,
"indefinite_horizon_months": 6,
"calculation_version": 123
},
"qualification_metric": "quality_rating",
"projection_context": {
"indefinite_horizon_months": 6,
"display_mode": "CURRENT"
},
"crm_loss_reasons": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
],
"deals": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": 123,
"title": "<string>",
"status": 1,
"archived_at": "2023-11-07T05:31:56Z",
"won_date": "2023-11-07T05:31:56Z",
"lost_date": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"stage": {
"id": "<string>",
"name": "<string>",
"pipeline": {
"id": "<string>",
"name": "<string>"
}
},
"value": 123,
"responsible": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
}
]
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Consulta de lead
Retorna detalhes completos do lead informado. O id pode ser UUID ou o código numérico interno. Considera visibilidade do usuário criador da chave.
Os resumos de chats dependem exclusivamente de crm/chats.read na chave. Sem esse grant, flags são false e listas de chats são vazias. A resposta inclui valuation e projection_context para os valores comerciais e seus critérios de exibição. Cada consulta registra uma visualização do usuário criador da chave: views_count aumenta e o registro deixa de aparecer em only_new=true.
curl --request GET \
--url https://api.wegly.com.br/integrations/external/leads/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.wegly.com.br/integrations/external/leads/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wegly.com.br/integrations/external/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.wegly.com.br/integrations/external/leads/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wegly.com.br/integrations/external/leads/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wegly.com.br/integrations/external/leads/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wegly.com.br/integrations/external/leads/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"code": 123,
"title": "<string>",
"measurement_consent": "GRANTED",
"created_by": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"stage": {
"id": "<string>",
"name": "<string>",
"pipeline": {
"id": "<string>",
"name": "<string>"
}
},
"pipeline_stages": [
{
"id": "<string>",
"name": "<string>",
"position": 123
}
],
"responsible": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"lead_source": {
"id": "<string>",
"name": "<string>",
"logo": "<string>"
},
"marketing_lead_source": {
"id": "<string>",
"utm_search_term": "<string>",
"utm_medium": "<string>",
"lead_source": {
"id": "<string>",
"name": "<string>",
"logo": "<string>"
},
"url_conversion": "<string>",
"campaing_name": "<string>",
"ad_set_name": "<string>",
"content_name": "<string>",
"displayed_on_name": "<string>",
"conversion_tool_name": "<string>",
"creative": {
"id": "<string>",
"value": "<string>",
"creative_uri": "<string>"
},
"source_url": "<string>",
"headline": "<string>",
"ad_body": "<string>",
"media_type": "<string>",
"ads_clid_id": "<string>",
"gclid": "<string>",
"fbclid": "<string>",
"fbc": "<string>",
"fbp": "<string>",
"conversion_url_full": "<string>",
"measurement_consent": "GRANTED"
},
"quality_rating": 123,
"quality_reason": "<string>",
"won_date": "2023-11-07T05:31:56Z",
"lost_date": "2023-11-07T05:31:56Z",
"crm_loss_reason": {
"id": "<string>",
"name": "<string>"
},
"lost_reason_description": "<string>",
"visibility": 0,
"negotiation_mode": 123,
"created_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"last_activity_at": "2023-11-07T05:31:56Z",
"participants": [
{
"id": "<string>",
"main": true,
"role": "<string>",
"notes": "<string>",
"person": {
"id": "<string>",
"name": "<string>",
"contacts": [
{
"id": "<string>",
"type": 0,
"value": "<string>",
"primary": true
}
]
}
}
],
"organization": {
"id": "<string>",
"name": "<string>",
"logo": "<string>"
},
"custom_fields": [
{
"field_id": "<string>",
"field_name": "<string>",
"field_type": 123,
"answers": [
{
"id": "<string>",
"option_id": "<string>",
"option_value": "<string>",
"value": "<string>"
}
]
}
],
"tags": [
{
"id": "<string>",
"name": "<string>",
"color": {
"background": "<string>",
"foreground": "<string>"
}
}
],
"stage_durations": [
{
"stage_id": "<string>",
"stage_name": "<string>",
"total_seconds": 123,
"human_readable": "<string>"
}
],
"value": 123,
"views_count": 123,
"associations_count": {
"items": 123,
"tasks": 123,
"qualifications": 123,
"notes": 123,
"files": 123,
"activities": 123,
"proposals": 123,
"deals": 123
},
"proposals": [
{
"id": "<string>",
"code": 123,
"version": 123,
"title": "<string>",
"status": 123,
"is_primary": true,
"discount_type": 123,
"discount_value": 123,
"subtotal": 123,
"total": 123,
"valid_until": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"approved_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"rejected_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"approved_by": {
"id": "<string>",
"name": "<string>"
}
}
],
"followers": [
{
"role": {
"id": "<string>",
"name": "<string>"
},
"user": {
"id": "<string>",
"name": "<string>",
"avatar": "<string>"
},
"notes": "<string>"
}
],
"icp": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"banner_type": "<string>",
"banner_image_url": "<string>",
"banner_color": "<string>",
"gradient_start_color": "<string>",
"gradient_end_color": "<string>",
"gradient_angle": 123
},
"icps": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"banner_type": "<string>",
"banner_image_url": "<string>",
"banner_color": "<string>",
"gradient_start_color": "<string>",
"gradient_end_color": "<string>",
"gradient_angle": 123,
"is_primary": true
}
],
"partners": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": 123,
"name": "<string>",
"trade_name": "<string>",
"logo": "<string>",
"documents": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": 123,
"value": "<string>",
"label": "<string>",
"is_primary": true
}
],
"address": {
"city": "<string>",
"state": "<string>",
"country": "<string>",
"zip_code": "<string>",
"street": "<string>",
"number": "<string>",
"complement": "<string>",
"neighborhood": "<string>",
"formatted_address": "<string>",
"latitude": 123,
"longitude": 123
}
}
],
"has_channel_chat": true,
"channel_chats": [
{
"chat_id": "<string>",
"title": "<string>",
"person_id": "<string>",
"person_name": "<string>",
"channel_account_id": "<string>",
"type": "WhatsApp",
"channel_type": "WHATSAPP",
"unread_count": 123,
"channel_account_name": "<string>",
"whatsapp_number_verified_name": "<string>",
"external_contact_id": "<string>",
"external_contact_handle": "<string>",
"chat_responsible": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
}
],
"has_whatsapp_chat": true,
"whatsapp_chats": [
{
"chat_id": "<string>",
"title": "<string>",
"person_id": "<string>",
"person_name": "<string>",
"channel_account_id": "<string>",
"type": "WhatsApp",
"channel_type": "WHATSAPP",
"unread_count": 123,
"channel_account_name": "<string>",
"whatsapp_number_verified_name": "<string>",
"external_contact_id": "<string>",
"external_contact_handle": "<string>",
"chat_responsible": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
}
],
"score": 123,
"score_criteria_count": 123,
"score_updated_at": "2023-11-07T05:31:56Z",
"valuation": {
"mode": "CURRENT",
"source": "LEGACY_CURRENT_VALUE",
"current_value": 123,
"projected_value": 123,
"display_value": 123,
"has_recurring_value": true,
"has_indefinite_recurring_value": true,
"has_rolling_projection": true,
"indefinite_horizon_months": 6,
"calculation_version": 123
},
"qualification_metric": "quality_rating",
"projection_context": {
"indefinite_horizon_months": 6,
"display_mode": "CURRENT"
},
"crm_loss_reasons": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
],
"deals": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"code": 123,
"title": "<string>",
"status": 1,
"archived_at": "2023-11-07T05:31:56Z",
"won_date": "2023-11-07T05:31:56Z",
"lost_date": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"stage": {
"id": "<string>",
"name": "<string>",
"pipeline": {
"id": "<string>",
"name": "<string>"
}
},
"value": 123,
"responsible": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
}
]
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Authorizations
Chave de integração com prefixo wegly_, enviada em Authorization: Bearer . Não é JWT. A chave deve estar ativa, não excluída e dentro da validade. Com allowed_domain, Origin (ou Referer na ausência de Origin) precisa informar o hostname permitido. A empresa e as permissões são obtidas pela chave.
Response
Detalhes do lead.
Detalhamento completo retornado no GET /integrations/external/leads/{id}.
Consentimento para mensuração: GRANTED autoriza, DENIED recusa e UNSPECIFIED registra que não houve decisão informada. Em respostas de registros históricos sem valor canônico oficial, a API usa a decisão oficial do snapshot ativo mais recente; snapshots sem decisão não a sombreiam e a ausência de ambos resulta em UNSPECIFIED, sem backfill.
GRANTED, DENIED, UNSPECIFIED 