curl --request GET \
--url https://api.wizebot.com.br/v1/conversations/{conversation_id}/messages \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wizebot.com.br/v1/conversations/{conversation_id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.wizebot.com.br/v1/conversations/{conversation_id}/messages';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.wizebot.com.br/v1/conversations/{conversation_id}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wizebot.com.br/v1/conversations/{conversation_id}/messages",
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;
}{
"success": true,
"data": {
"items": [
{
"message_id": "a1",
"direction": "inbound",
"type": "image",
"status": "read",
"text": "olha isto",
"media": {
"media_id": "wamid.HBgN",
"media_status": "available",
"mime_type": "image/jpeg",
"file_size": 84213,
"filename": null
},
"reactions": [],
"sent_at": "2026-09-13T02:44:51.602Z",
"delivered_at": null,
"read_at": "2026-09-13T02:45:10.000Z",
"failure_reason": null,
"raw": {
"mediaId": "wamid.HBgN",
"caption": "olha isto"
}
}
],
"next_cursor": null,
"window": {
"recent_window_days": 30,
"since": "2026-08-14T03:20:00.000Z"
}
},
"timestamp": "2026-09-13T03:20:00.000Z"
}{
"success": false,
"statusCode": 400,
"timestamp": "2026-09-13T03:20:00.000Z",
"path": "/api/v1/conversations/{id}/messages",
"method": "GET",
"message": {
"error": "INVALID_PARAM",
"message": "limit must be an integer between 1 and 100."
},
"errorId": "ERR-MTUD0DBO-KKRMP8"
}{
"success": false,
"statusCode": 401,
"timestamp": "2026-09-13T03:20:00.000Z",
"path": "/api/v1/conversations",
"method": "GET",
"message": {
"error": "UNAUTHORIZED",
"message": "Invalid or missing API key."
},
"errorId": "ERR-MTUD0DBO-KKRMP8"
}{
"success": false,
"statusCode": 404,
"timestamp": "2026-09-13T03:20:00.000Z",
"path": "/api/v1/conversations/{id}/messages",
"method": "GET",
"message": {
"error": "CONVERSATION_NOT_FOUND",
"message": "Conversation not found."
},
"errorId": "ERR-MTUD0DBO-KKRMP8"
}{
"success": false,
"statusCode": 429,
"timestamp": "2026-09-13T03:20:00.000Z",
"path": "/api/v1/conversations",
"method": "GET",
"message": {
"error": "RATE_LIMITED",
"message": "Too many requests."
},
"errorId": "ERR-MTUD0DBO-KKRMP8"
}Ler mensagens de uma conversa
Do mais recente para o mais antigo, por cursor. A entrada é só o conversation_id.
A janela recente
Sem since, a leitura cobre os últimos 30 dias. Isso é decisão de produto, não limite técnico — medimos que a paginação profunda é barata e de custo constante, então o teto não existe para proteger o servidor. Ele existe para separar ler a conversa de baixar o histórico inteiro: para alcançar o que está além da janela, informe since e a intenção fica declarada na requisição.
A resposta devolve em window a janela efetivamente aplicada, para você nunca precisar adivinhar.
Mídia vem em dois passos
A mensagem nunca traz URL nem caminho de armazenamento. Ela traz media.media_id; troque por um endereço temporário em GET /v1/attachments/{media_id}.
Nem toda mensagem de mídia tem arquivo recuperável. Quando media.media_id vier null, não chame o anexo — não há o que resolver. O bloco media nunca é omitido: se a mensagem é de mídia, ele existe, e media_status diz o que houve.
media_status | O que significa | media_id |
|---|---|---|
available | Arquivo registrado e recuperável | preenchido |
unknown | Mídia recebida antes do registro interno, ou cujo arquivo não foi guardado. É o caso da maior parte do histórico antigo | null |
no_reference | A mensagem não carrega nenhuma informação de mídia | null |
Numa conversa com histórico longo, esperar que toda imagem resolva é a suposição errada — trate media_id: null como caso normal, não como erro.
Formas especiais
Reações não aparecem como mensagens próprias: elas vêm no campo reactions da mensagem reagida. Mensagens de sistema e não suportadas vêm com o tipo explícito e sem corpo — text, media e raw nulos.
O campo raw está fora de contrato. Ele carrega a forma interna do conteúdo, útil para os tipos que os campos próprios não cobrem, e pode mudar sem aviso — inclusive entre versões sem nota de mudança. Não construa integração que dependa da forma dele.
Esta leitura também não traz contagem de mensagens da conversa; veja a nota em GET /v1/conversations.
curl --request GET \
--url https://api.wizebot.com.br/v1/conversations/{conversation_id}/messages \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wizebot.com.br/v1/conversations/{conversation_id}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.wizebot.com.br/v1/conversations/{conversation_id}/messages';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.wizebot.com.br/v1/conversations/{conversation_id}/messages"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wizebot.com.br/v1/conversations/{conversation_id}/messages",
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;
}{
"success": true,
"data": {
"items": [
{
"message_id": "a1",
"direction": "inbound",
"type": "image",
"status": "read",
"text": "olha isto",
"media": {
"media_id": "wamid.HBgN",
"media_status": "available",
"mime_type": "image/jpeg",
"file_size": 84213,
"filename": null
},
"reactions": [],
"sent_at": "2026-09-13T02:44:51.602Z",
"delivered_at": null,
"read_at": "2026-09-13T02:45:10.000Z",
"failure_reason": null,
"raw": {
"mediaId": "wamid.HBgN",
"caption": "olha isto"
}
}
],
"next_cursor": null,
"window": {
"recent_window_days": 30,
"since": "2026-08-14T03:20:00.000Z"
}
},
"timestamp": "2026-09-13T03:20:00.000Z"
}{
"success": false,
"statusCode": 400,
"timestamp": "2026-09-13T03:20:00.000Z",
"path": "/api/v1/conversations/{id}/messages",
"method": "GET",
"message": {
"error": "INVALID_PARAM",
"message": "limit must be an integer between 1 and 100."
},
"errorId": "ERR-MTUD0DBO-KKRMP8"
}{
"success": false,
"statusCode": 401,
"timestamp": "2026-09-13T03:20:00.000Z",
"path": "/api/v1/conversations",
"method": "GET",
"message": {
"error": "UNAUTHORIZED",
"message": "Invalid or missing API key."
},
"errorId": "ERR-MTUD0DBO-KKRMP8"
}{
"success": false,
"statusCode": 404,
"timestamp": "2026-09-13T03:20:00.000Z",
"path": "/api/v1/conversations/{id}/messages",
"method": "GET",
"message": {
"error": "CONVERSATION_NOT_FOUND",
"message": "Conversation not found."
},
"errorId": "ERR-MTUD0DBO-KKRMP8"
}{
"success": false,
"statusCode": 429,
"timestamp": "2026-09-13T03:20:00.000Z",
"path": "/api/v1/conversations",
"method": "GET",
"message": {
"error": "RATE_LIMITED",
"message": "Too many requests."
},
"errorId": "ERR-MTUD0DBO-KKRMP8"
}Authorizations
Chave de API no cabeçalho Authorization: Bearer SUA-CHAVE.
A API também aceita x-api-key: SUA-CHAVE e Authorization: ApiKey SUA-CHAVE — as três formas são equivalentes, inclusive para o limite de requisições.
A chave dá acesso total à conta e é de servidor para servidor: não a use em navegador ou aplicativo móvel.
Path Parameters
Query Parameters
Para ler além dos 30 dias recentes.
x <= 100
