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>",
"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>",
"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>"
}
},
"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>",
"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>",
"role": {
"id": "<string>",
"name": "<string>"
},
"notes": "<string>",
"person": {
"id": "<string>",
"name": "<string>",
"contacts": [
{
"id": "<string>",
"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": "<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
},
"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>"
}
]
}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.
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>",
"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>",
"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>"
}
},
"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>",
"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>",
"role": {
"id": "<string>",
"name": "<string>"
},
"notes": "<string>",
"person": {
"id": "<string>",
"name": "<string>",
"contacts": [
{
"id": "<string>",
"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": "<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
},
"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>"
}
]
}Authorizations
Utilize o token de integração no header Authorization: Bearer {token}. O domínio de origem (Origin/Referer) deve respeitar allowed_domain, quando configurado na chave.
Path Parameters
UUID do lead ou código numérico interno.
Response
Detalhes do lead.
Detalhamento completo retornado no GET /integrations/external/leads/{id}.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Origem direta do lead (crm_lead_source).
Show child attributes
Show child attributes
Último registro de rastreio (crm_marketing_lead_source). Valores textuais têm prioridade sobre relações.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
0 = privado (responsável, membros dos times do responsável e supervisores), 1 = restrito ao responsável e times relacionados.
0, 1 Participantes do lead com informações de contato.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Respostas de campos customizados agrupadas por campo.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Tempo acumulado por etapa (segundos e texto legível).
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
