GET /api/webhooks
Retorna todos os webhooks registrados pelo usuário autenticado.
Autenticação
Scope necessário: webhooks:read
Inclua o header Authorization: Bearer <api-key> ou use cookie de sessão.
Requisição
GET /api/webhooks
Headers
| Header | Obrigatório | Descrição |
|---|---|---|
Authorization | sim | Bearer pk_... (API key) ou cookie de sessão |
Exemplo
curl "https://api.placaflow.com.br/api/webhooks" \
-H "Authorization: Bearer pk_a1b2c3d4e5f6g7h8i9j0..."
Resposta 200
{
"webhooks": [
{
"id": "w1b2c3d4-5678-9abc-def0-123456789abc",
"userId": "c3a1e902-4f5b-4b8a-9c6d-1a2b3c4d5e6f",
"createdAt": "2026-03-10T10:00:00.000Z",
"updatedAt": "2026-03-20T14:00:00.000Z",
"name": "Sistema ERP",
"url": "https://api.example.com/webhook/placaflow",
"secret": "whsec_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"enabled": true,
"events": ["recognition.created", "alert.triggered"],
"headers": { "X-Source": "placaflow" },
"lastDeliveryAt": "2026-03-22T14:30:00.000Z",
"lastDeliveryStatus": 200,
"failureCount": 0
},
{
"id": "w2c3d4e5-6789-abcd-ef01-23456789abcd",
"userId": "c3a1e902-4f5b-4b8a-9c6d-1a2b3c4d5e6f",
"createdAt": "2026-03-05T08:00:00.000Z",
"updatedAt": "2026-03-05T08:00:00.000Z",
"name": "Monitor de câmeras",
"url": "https://status.example.com/hooks/cameras",
"secret": "whsec_q1r2s3t4u5v6w7x8y9z0a1b2c3d4e5f6",
"enabled": true,
"events": ["camera.online", "camera.offline"],
"headers": {},
"lastDeliveryAt": "2026-03-22T12:00:00.000Z",
"lastDeliveryStatus": 200,
"failureCount": 0
}
]
}
Campos de cada webhook
| Campo | Tipo | Descrição |
|---|---|---|
id | string | UUID único do webhook |
userId | string | UUID do proprietário |
createdAt | string | Data de criação ISO 8601 |
updatedAt | string | Data da última atualização ISO 8601 |
name | string | Nome do webhook |
url | string | URL do endpoint de destino |
secret | string | Secret para verificação HMAC-SHA256 |
enabled | boolean | Webhook ativo ou desativado |
events | string[] | Lista de eventos assinados |
headers | object | Headers HTTP customizados enviados com cada requisição |
lastDeliveryAt | string? | Data/hora da última entrega ISO 8601 |
lastDeliveryStatus | number? | Código HTTP da última entrega |
failureCount | number | Número de falhas consecutivas de entrega |
Erros
| Código | Descrição |
|---|---|
| 401 | Não autenticado ou API key inválida |
| 403 | API key não possui scope webhooks:read |