Ver últimos erros do webhook global
GET /globalwebhook/errors
Retorna em memória os últimos 20 erros de entrega do webhook global.
Cada item inclui data/hora (created), URL de destino, evento, tipo do webhook
(global), payload tentado, número de tentativas, status HTTP final quando existir e a mensagem de erro.
Observações:
- O histórico fica apenas em memória e é perdido quando o processo reinicia.
- O endpoint exige
admintoken. - Útil para diagnosticar falhas do webhook global sem expor esses dados aos tokens das instâncias.
- O header
X-Webhook-Error-Capture-Started-Atinforma desde quando a captura atual está valendo.
Exemplo de consulta:
curl -X GET "$BASE_URL/globalwebhook/errors" \
-H "admintoken: SEU_ADMIN_TOKEN"
Autenticação
[
{
"admintoken": []
}
]
{
"admintoken": {
"name": "admintoken",
"type": "apiKey",
"in": "header",
"description": "Token de administrador para endpoints administrativos"
}
}
Respostas
{
"200": {
"description": "Histórico global retornado com sucesso",
"headers": {
"X-Webhook-Error-Capture-Started-At": {
"description": "Data/hora em que a captura atual de erros globais começou",
"schema": {
"type": "string",
"format": "date-time",
"example": "2026-03-23T14:50:00Z"
}
}
},
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"created": {
"type": "string",
"format": "date-time",
"example": "2026-03-23T15:04:05Z"
},
"url": {
"type": "string",
"example": "https://example.com/webhook/messages"
},
"type": {
"type": "string",
"example": "global"
},
"event": {
"type": "string",
"example": "messages"
},
"message_type": {
"type": "string",
"example": "text"
},
"status_code": {
"type": "integer",
"example": 502
},
"attempts": {
"type": "integer",
"example": 3
},
"error": {
"type": "string",
"example": "webhook returned non-success status: 502 Bad Gateway"
},
"payload": {
"type": "object"
}
}
}
},
"example": [
{
"created": "2026-03-23T15:08:00Z",
"url": "https://example.com/global/messages",
"type": "global",
"event": "messages",
"message_type": "text",
"status_code": 502,
"attempts": 3,
"error": "webhook returned non-success status: 502 Bad Gateway",
"payload": {
"EventType": "messages",
"token": "instance-token"
}
}
]
}
}
},
"401": {
"description": "Token de administrador não fornecido",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Unauthorized"
}
}
}
}
}
},
"403": {
"description": "Token de administrador inválido ou servidor demo",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "This is a public demo server. This endpoint has been disabled."
}
}
}
}
}
}
}