Webhooks
Os webhooks notificam o seu servidor quando algo acontece no Meetingize, para que não precise de fazer polling. Cada entrega é um
POST HTTPS com um evento JSON, assinado com um segredo que só você e o Meetingize conhecem.
Registar um endpoint
Seção intitulada “Registar um endpoint”Na aplicação web: Definições > Developers > Adicionar um endpoint. Ou através da API com o scope webhooks:
curl -s -X POST "$MEETINGIZE_API/webhook_endpoints" \ -H "Authorization: Bearer $MEETINGIZE_API_KEY" -H "Content-Type: application/json" \ -d '{"url": "https://hooks.example.com/meetingize", "events": ["transcription.completed", "document.generated"]}'A resposta contém o secret de assinatura (whsec_...), apresentado uma única vez. Os URL devem utilizar https e resolver para um
endereço público (os endereços privados e de loopback são recusados). Para testar localmente, exponha o seu endpoint com um túnel
(por exemplo ngrok ou Cloudflare Tunnel).
Eventos
Seção intitulada “Eventos”| Tipo | Quando | data.object |
|---|---|---|
transcription.completed | a transcrição com diarização está disponível | tarefa (+ meeting) |
transcription.failed | a transcrição falhou | tarefa com error |
processing.completed | o relatório de IA da reunião está pronto | tarefa (+ meeting) |
processing.failed | o relatório de IA falhou após uma transcrição bem-sucedida | tarefa com error |
document.generated | uma geração de documento foi bem-sucedida | tarefa (+ document) |
document.failed | uma geração de documento falhou | tarefa com error |
usage.threshold_reached | a utilização da API do mês atingiu 50, 80 ou 100 % da carteira, ou 80 ou 100 % do limite de despesa | usage_alert |
ping | botão “enviar um teste” ou POST /webhook_endpoints/{id}/test | { "message": "..." } |
Subscreva "*" para receber todos os eventos exceto ping.
{ "id": "evt_7d1f...", "object": "event", "type": "transcription.completed", "created": "2026-10-11T14:03:22Z", "api_version": "2026-10-01", "livemode": false, "data": { "object": { "id": "job_9b0c...", "object": "job", "kind": "transcription", "status": "running", "stage": "processing", "meeting_id": "1b9e...", "metadata": { "crm_id": "42" }, "meeting": { "id": "1b9e...", "object": "meeting", "title": "RDV client", "status": "transcribed" } } }}Cabeçalhos
Seção intitulada “Cabeçalhos”Content-Type: application/jsonUser-Agent: Meetingize-Webhooks/1.0Meetingize-Event-Id: evt_7d1f...Meetingize-Event-Type: transcription.completedMeetingize-Delivery-Id: whd_...Meetingize-Signature: t=1760191402,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bdVerificar a assinatura
Seção intitulada “Verificar a assinatura”v1 é o HMAC-SHA256 em hexadecimal de "{t}.{raw_body}" com o seu segredo completo (whsec_...) como chave. Para verificar:
- leia o corpo bruto do pedido (antes de qualquer análise do JSON);
- recalcule o HMAC e compare-o em tempo constante com cada valor
v1=do cabeçalho; - recuse o evento se
testiver a mais de 5 minutos do momento atual (proteção contra repetição); - desduplique por
Meetingize-Event-Id(as entregas são pelo menos uma vez).
Durante uma rotação de segredo, o segredo antigo continua válido durante 24 horas e o cabeçalho contém dois valores v1=.
import hashlib, hmac, time
def verify_meetingize_signature(raw_body: bytes, header: str, secret: str, tolerance: int = 300) -> bool: items = [p.split("=", 1) for p in header.split(",") if "=" in p] timestamps = [v for k, v in items if k == "t"] signatures = [v for k, v in items if k == "v1"] if not timestamps or not signatures: return False t = int(timestamps[0]) if abs(time.time() - t) > tolerance: return False expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest() return any(hmac.compare_digest(expected, s) for s in signatures)
# Flask examplefrom flask import Flask, request, abortapp = Flask(__name__)
@app.post("/meetingize")def meetingize_webhook(): if not verify_meetingize_signature(request.get_data(), request.headers.get("Meetingize-Signature", ""), secret="whsec_..."): abort(400) event = request.get_json() # enqueue work, return fast return "", 204Node.js
Seção intitulada “Node.js”import crypto from 'node:crypto';import express from 'express';
function verifyMeetingizeSignature(rawBody, header, secret, toleranceSec = 300) { const parts = (header || '').split(',').map((p) => p.split('=')); const t = Number((parts.find(([k]) => k === 't') || [])[1]); const sigs = parts.filter(([k]) => k === 'v1').map(([, v]) => v); if (!t || !sigs.length || Math.abs(Date.now() / 1000 - t) > toleranceSec) return false; const expected = crypto.createHmac('sha256', secret).update(`${t}.`).update(rawBody).digest('hex'); return sigs.some((s) => s.length === expected.length && crypto.timingSafeEqual(Buffer.from(s), Buffer.from(expected)));}
const app = express();// Keep the raw body: verification must run on the exact bytes receivedapp.post('/meetingize', express.raw({ type: 'application/json' }), (req, res) => { if (!verifyMeetingizeSignature(req.body, req.get('Meetingize-Signature'), process.env.MEETINGIZE_WEBHOOK_SECRET)) { return res.sendStatus(400); } const event = JSON.parse(req.body.toString('utf8')); res.sendStatus(204);});Shell (depuração)
Seção intitulada “Shell (depuração)”BODY_FILE=event.json # raw body as receivedHEADER='t=1760191402,v1=5257a8...'SECRET='whsec_...'T=$(echo "$HEADER" | tr ',' '\n' | sed -n 's/^t=//p')EXPECTED=$( { printf '%s.' "$T"; cat "$BODY_FILE"; } | openssl dgst -sha256 -hmac "$SECRET" -hex | sed 's/^.* //')echo "$HEADER" | tr ',' '\n' | grep -q "^v1=$EXPECTED$" && echo "valid" || echo "INVALID"A CLI meetingize tem também meetingize webhooks verify.
Entrega, repetições e desativação
Seção intitulada “Entrega, repetições e desativação”- O seu endpoint deve responder
2xxem 10 segundos. Os redirecionamentos não são seguidos. Faça o trabalho de forma assíncrona e responda rapidamente. - As entregas falhadas são repetidas após 1 min, 5 min, 30 min, 2 h, 6 h, 12 h e 24 h (8 tentativas no total), e depois
marcadas como
failed. - Após 15 tentativas falhadas consecutivas, o endpoint é desativado (
disabled_reason: "too_many_failures") e o proprietário recebe um e-mail. Reative-o comPATCH /v1/webhook_endpoints/{id}{"enabled": true}ou a partir da aplicação web. - O registo de entregas (estado, código HTTP, primeiro 1 KB da sua resposta, duração, próxima repetição) é visível na aplicação
web e com
GET /v1/webhook_endpoints/{id}/deliveries, conservado 30 dias. - A ordem não é garantida. Utilize
createde o estado da tarefa, não a ordem de chegada.
Renovar o segredo
Seção intitulada “Renovar o segredo”POST /v1/webhook_endpoints/{id}/rotate_secret devolve um novo segredo. Ambos os segredos assinam as entregas durante 24 horas,
o que lhe dá tempo para implementar o novo.