Events API

v1Estável

Eventos em tempo real e webhooks

Visão Geral

Receba eventos da plataforma em tempo real via webhooks ou consulte o stream de eventos histórico.

Documentação

Autenticação

API Key com escopo events:read e events:write passada no header X-Api-Key.

Tipos de Evento

face.identified, time.record, access.granted, access.denied, device.offline.

Retry

Webhooks com falha reenviam até 5 vezes com backoff exponencial.

Segurança

Assine o payload com HMAC-SHA256 usando o secret do webhook.

Referência da API

GET/v1/events
POST/v1/webhooks
GET/v1/webhooks/{id}
DELETE/v1/webhooks/{id}
GET/v1/webhooks/{id}/deliveries
exemplo.ts
sandbox
// Criar webhook
const response = await fetch(
  'https://api.smartpoint.app.br/v1/webhooks',
  {
    method: 'POST',
    headers: { 'X-Api-Key': 'SUA_API_KEY', 'Content-Type': 'application/json' },
    body: JSON.stringify({
      url: 'https://meu-sistema.com/webhook',
      events: ['face.identified', 'access.granted'],
    }),
  }
);
const { id, secret } = await response.json();