curl --request GET \
--url https://api.wegly.com.br/integrations/external/chats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.wegly.com.br/integrations/external/chats"
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/chats', 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/chats",
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/chats"
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/chats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wegly.com.br/integrations/external/chats")
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{
"total": 123,
"records": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"wa_contact_id": "<string>",
"contact_name": "<string>",
"contact_number": "<string>",
"status": "OPEN",
"chat_type": "INDIVIDUAL",
"unread_count": 123,
"is_manually_unread": true,
"priority": 0,
"can_send_open_message": true,
"channel_type": "WHATSAPP",
"channel_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"archived_at": "2023-11-07T05:31:56Z",
"assigned_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display_number": "<string>"
},
"assigned_agent": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
},
"last_message_at": "2023-11-07T05:31:56Z",
"last_message": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "text",
"origin": "INBOUND",
"from_me": true,
"sent_via": "CONTACT",
"status": "processing",
"body_text": "<string>",
"content_payload": {},
"reactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"emoji": "<string>",
"actor": "CONTACT",
"reactor_wa_id": "<string>",
"reactor_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
}
],
"meta_timestamp": "2023-11-07T05:31:56Z",
"is_history": true,
"history_phase": 123,
"history_chunk_order": 123,
"history_progress": 123,
"is_media_placeholder": true,
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
},
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"crm_marketing_lead_source": [
{}
],
"transcription": "<string>",
"is_forwarded": true,
"whatsapp_ai_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"crm_person": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"last_customer_msg_at": "2023-11-07T05:31:56Z",
"session_expires_at": "2023-11-07T05:31:56Z",
"has_pending_copilot_actions": true,
"pending_copilot_actions_count": 123,
"has_active_whatsapp_flow_session": true,
"active_whatsapp_flow_sessions": [
{
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"flow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"flow_name": "<string>",
"status": "ACTIVE",
"status_label": "<string>",
"is_active": true,
"started_at": "2023-11-07T05:31:56Z",
"last_activity_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"current_step": {
"node_id": "<string>",
"node_key": "<string>",
"name": "<string>",
"status": "<string>",
"status_label": "<string>",
"branch_key": "<string>",
"branch_label": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z"
},
"journey": {
"completed_steps": [
{
"node_id": "<string>",
"node_key": "<string>",
"name": "<string>",
"status": "<string>",
"status_label": "<string>",
"branch_key": "<string>",
"branch_label": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z"
}
],
"current_step": {
"node_id": "<string>",
"node_key": "<string>",
"name": "<string>",
"status": "<string>",
"status_label": "<string>",
"branch_key": "<string>",
"branch_label": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z"
},
"upcoming_steps": [
{
"node_id": "<string>",
"node_key": "<string>",
"name": "<string>",
"status": "<string>",
"status_label": "<string>",
"branch_key": "<string>",
"branch_label": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z"
}
]
}
}
],
"has_upcoming_scheduled_message": true,
"channel_account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"display_name": "<string>",
"provider_status": "<string>"
},
"external_contact": {
"id": "<string>",
"handle": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
},
"legacy": {
"whatsapp_chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"whatsapp_phone_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"wa_contact_id": "<string>"
},
"ai_attendance": {
"state": "AI",
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"profile_name": "<string>"
},
"since": "2023-11-07T05:31:56Z",
"end_reason": "TRANSFER_RULE",
"transferred_to": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
}
}
],
"next_cursor": "<string>"
}Listar chats
Lista WhatsApp e Instagram em ordenação unificada. Reutilize next_cursor para paginação estável. Filtros positivos de agendamento, Copilot e resposta do cliente excluem conversas Instagram. Registros de WhatsApp incluem ai_attendance, com o resumo do atendimento por agente de IA. Permissão da chave: crm/chats.read. O acesso também respeita a empresa e as permissões do usuário criador da chave.
curl --request GET \
--url https://api.wegly.com.br/integrations/external/chats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.wegly.com.br/integrations/external/chats"
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/chats', 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/chats",
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/chats"
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/chats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wegly.com.br/integrations/external/chats")
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{
"total": 123,
"records": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"wa_contact_id": "<string>",
"contact_name": "<string>",
"contact_number": "<string>",
"status": "OPEN",
"chat_type": "INDIVIDUAL",
"unread_count": 123,
"is_manually_unread": true,
"priority": 0,
"can_send_open_message": true,
"channel_type": "WHATSAPP",
"channel_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"archived_at": "2023-11-07T05:31:56Z",
"assigned_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phone_number": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"display_number": "<string>"
},
"assigned_agent": {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
},
"last_message_at": "2023-11-07T05:31:56Z",
"last_message": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "text",
"origin": "INBOUND",
"from_me": true,
"sent_via": "CONTACT",
"status": "processing",
"body_text": "<string>",
"content_payload": {},
"reactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"emoji": "<string>",
"actor": "CONTACT",
"reactor_wa_id": "<string>",
"reactor_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
}
],
"meta_timestamp": "2023-11-07T05:31:56Z",
"is_history": true,
"history_phase": 123,
"history_chunk_order": 123,
"history_progress": 123,
"is_media_placeholder": true,
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
}
},
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"avatar": "<string>"
},
"crm_marketing_lead_source": [
{}
],
"transcription": "<string>",
"is_forwarded": true,
"whatsapp_ai_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"crm_person": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"last_customer_msg_at": "2023-11-07T05:31:56Z",
"session_expires_at": "2023-11-07T05:31:56Z",
"has_pending_copilot_actions": true,
"pending_copilot_actions_count": 123,
"has_active_whatsapp_flow_session": true,
"active_whatsapp_flow_sessions": [
{
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"flow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"flow_name": "<string>",
"status": "ACTIVE",
"status_label": "<string>",
"is_active": true,
"started_at": "2023-11-07T05:31:56Z",
"last_activity_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"current_step": {
"node_id": "<string>",
"node_key": "<string>",
"name": "<string>",
"status": "<string>",
"status_label": "<string>",
"branch_key": "<string>",
"branch_label": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z"
},
"journey": {
"completed_steps": [
{
"node_id": "<string>",
"node_key": "<string>",
"name": "<string>",
"status": "<string>",
"status_label": "<string>",
"branch_key": "<string>",
"branch_label": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z"
}
],
"current_step": {
"node_id": "<string>",
"node_key": "<string>",
"name": "<string>",
"status": "<string>",
"status_label": "<string>",
"branch_key": "<string>",
"branch_label": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z"
},
"upcoming_steps": [
{
"node_id": "<string>",
"node_key": "<string>",
"name": "<string>",
"status": "<string>",
"status_label": "<string>",
"branch_key": "<string>",
"branch_label": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z"
}
]
}
}
],
"has_upcoming_scheduled_message": true,
"channel_account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "<string>",
"display_name": "<string>",
"provider_status": "<string>"
},
"external_contact": {
"id": "<string>",
"handle": "<string>",
"display_name": "<string>",
"avatar_url": "<string>"
},
"legacy": {
"whatsapp_chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"whatsapp_phone_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"wa_contact_id": "<string>"
},
"ai_attendance": {
"state": "AI",
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"profile_name": "<string>"
},
"since": "2023-11-07T05:31:56Z",
"end_reason": "TRANSFER_RULE",
"transferred_to": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
}
}
],
"next_cursor": "<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.
Query Parameters
No WhatsApp, procura no nome do perfil do contato e no nome da pessoa vinculada; termos com formato de telefone também procuram no número do contato, com ou sem o nono dígito.
Quantidade de registros a pular; valores negativos são normalizados para zero.
Quantidade por página. O serviço limita o resultado a 50 registros.
Cursor opaco retornado em next_cursor; substitui o avanço por skip.
Sem filtro, combina os canais.
WHATSAPP, INSTAGRAM ID da conta do canal; sem channel_type, direciona a consulta a Instagram.
ID do número WhatsApp; direciona a consulta a WhatsApp.
OPEN, RESOLVED, SNOOZED Padrão exclui arquivados; include inclui todos; only retorna apenas arquivados.
include, only 0 = baixa, 1 = normal, 2 = alta, 3 = urgente.
0, 1, 2, 3 Filtro de responsável do WhatsApp; atualmente exclui Instagram. Um usuário que não é atendente do WhatsApp retorna lista vazia.
true considera unread_count > 0 ou is_manually_unread=true.
true filtra WhatsApp com mensagem agendada PENDING/PROCESSING, independentemente da data.
true filtra WhatsApp com ações pendentes de revisão.
Filtro de resposta do cliente em conversas WhatsApp.
initial_replied, initial_not_replied, not_replied_last_messages Quantidade de mensagens sem resposta (padrão efetivo 1), usada por not_replied_last_messages.
1 <= x <= 50