Consultar mensagem
/v1/instances/{id}/messages/{msg_id}desde M2token da instância ou adminQuando usar
Status de um envio: queued, in_flight, sent, delivered, read, played ou failed (com error no formato codigo: detalhe e attempts). Também aceita o id de uma mensagem recebida do log.
Autenticação
Aceita o token da instância (só a própria instância) ou o token admin. Um token de outra instância recebe 403 forbidden (ou 404 not_found em webhooks de outra instância).
Parâmetros
Caminho
| Nome | Tipo | Descrição |
|---|---|---|
idobrigatório | string | Id da instância (inst_...). |
msg_idobrigatório | string | id devolvido no envio (msg_...) ou id de uma mensagem do log. |
Exemplo
curl -s "$LITEZAP_URL/v1/instances/$ID/messages/$MSG_ID" \ -H "Authorization: Bearer $LITEZAP_TOKEN"const res = await fetch("http://localhost:8787/v1/instances/inst_7f3a9c2e5b1d4086/messages/msg_a41c9e07d2b35f68", { headers: { Authorization: `Bearer ${process.env.LITEZAP_TOKEN}` },});console.log(res.status, res.status === 204 ? "" : await res.json());import osimport requests
r = requests.get( "http://localhost:8787/v1/instances/inst_7f3a9c2e5b1d4086/messages/msg_a41c9e07d2b35f68", headers={"Authorization": f"Bearer {os.environ['LITEZAP_TOKEN']}"}, timeout=150,)print(r.status_code, r.json() if r.content else "")package main
import ( "fmt" "io" "net/http" "os")
func main() { req, _ := http.NewRequest("GET", "http://localhost:8787/v1/instances/inst_7f3a9c2e5b1d4086/messages/msg_a41c9e07d2b35f68", nil) req.Header.Set("Authorization", "Bearer "+os.Getenv("LITEZAP_TOKEN")) resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(resp.Status, string(out))}<?phprequire 'vendor/autoload.php'; // composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client(['base_uri' => 'http://localhost:8787']);$res = $client->request('GET', '/v1/instances/inst_7f3a9c2e5b1d4086/messages/msg_a41c9e07d2b35f68', [ 'headers' => ['Authorization' => 'Bearer ' . getenv('LITEZAP_TOKEN')], 'http_errors' => false,]);echo $res->getStatusCode(), ' ', $res->getBody(), PHP_EOL;Nos exemplos, LITEZAP_URL é a URL base (ex.: http://localhost:8787) e o token vem deLITEZAP_TOKEN (instância) ou LITEZAP_ADMIN_TOKEN.
Resposta
200 A mensagem.
Campos de Message
id | string | |
client_message_id | string | |
wa_message_id | string | |
chat | string | |
sender | string | |
from_me | boolean | |
source | "contact" | "api" | "device" | "history" | |
type | string | |
text | string | |
media | MediaInfo | |
media.id | string | Id da mídia recebida. |
media.kind | string | |
media.mime | string | |
media.size | integer | |
media.file_name | string | |
media.seconds | integer | |
media.ptt | boolean | |
media.url | string | Caminho da API para baixar (mídia recebida). |
reaction_to | string | |
status | "queued" | "in_flight" | "sent" | "delivered" | "read" | "played" | "failed" | "received" | "pending" | |
attempts | integer | |
error | string | Último erro (codigo: detalhe) de item não enviado. |
timestamp | string |
{ "id": "msg_a41c9e07d2b35f68", "wa_message_id": "3EB0A1B2C3D4E5F6A7B8C9", "chat": "5511999999999@s.whatsapp.net", "from_me": true, "source": "api", "type": "text", "text": "Olá!", "status": "delivered", "timestamp": "2026-10-17T13:50:03Z"}{ "id": "msg_0c5e8b2f9a7d4613", "chat": "5511888888888@s.whatsapp.net", "from_me": true, "source": "api", "type": "text", "text": "Olá!", "status": "failed", "attempts": 0, "error": "invalid_number: number is not on WhatsApp", "timestamp": "2026-10-17T13:51:00Z"}Erros
| Código | HTTP | Retentável | O que fazer |
|---|---|---|---|
unauthorized | 401 | não | Envie Authorization: Bearer <token> válido. |
forbidden | 403 | não | Use o token certo (admin, ou o da própria instância). |
not_found | 404 | não | Confira o id do recurso (mensagem, chat, contato, mídia ou webhook). |
instance_not_found | 404 | não | Confira o id da instância. |
Todo erro usa o envelope {"error":{"code","message","retryable"}}. Tabela completa em Erros.
Equivalente na Z-API: (sem equivalente; status chega por webhook). Veja Migrar da Z-API.
Outras operações de Mensagens: Enviar mensagem · Listar a fila · Esvaziar a fila · Cancelar item da fila · Favoritar mensagem

