cURL
curl --request GET \ --url https://api.enviaai.app/v1/webhooks/{webhookId}/logs \ --header 'Authorization: Bearer <token>'
{ "success": true, "data": [ { "id": "log_001", "event": "message.received", "status": "success", "statusCode": 200, "responseTime": 145, "timestamp": "2026-02-03T12:00:00.000Z" }, { "id": "log_002", "event": "message.sent", "status": "success", "statusCode": 200, "responseTime": 89, "timestamp": "2026-02-03T11:55:00.000Z" }, { "id": "log_003", "event": "message.received", "status": "failed", "statusCode": 500, "responseTime": 2000, "error": "Internal Server Error", "timestamp": "2026-02-03T11:50:00.000Z", "retryCount": 3 } ] }
Veja histórico de entregas do webhook
success
failed
const logs = await client.webhooks.getLogs('wh_xyz789', { limit: 50 }); logs.data.forEach(log => { const icon = log.status === 'success' ? '✓' : '✗'; console.log(`${icon} ${log.event} - ${log.statusCode} (${log.responseTime}ms)`); });
status: failed
{ "status": "failed", "statusCode": 500, "error": "Internal Server Error", "retryCount": 3, "nextRetryAt": "2026-02-03T12:10:00.000Z" }