# Testar localmente (https://docs.pongzap.com/webhooks/testar-localmente)

O PongZap só entrega em URLs HTTPS públicas. Para receber na sua máquina, exponha a porta local com um túnel:

```sh
# Cloudflare Tunnel, sem conta
cloudflared tunnel --url http://localhost:3000
# ou ngrok
ngrok http 3000
```

Cadastre a URL pública que o túnel mostrar e mande um evento de teste:

```sh
curl -s https://api.pongzap.com/v1/webhook_endpoints \
  -H "Authorization: Bearer $PONGZAP_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://xxxx.trycloudflare.com/webhooks/pongzap","enabled_events":["*"]}'

curl -s -X POST https://api.pongzap.com/v1/webhook_endpoints/we_…/test \
  -H "Authorization: Bearer $PONGZAP_KEY"
```

O `webhook.test` é assinado como qualquer evento: use-o para conferir a verificação. Ele chega mesmo se o endpoint estiver desativado ou não tiver `webhook.test` em `enabled_events`.

Quando terminar, apague o endpoint (`DELETE /v1/webhook_endpoints/{id}`): o túnel muda de endereço, e eventos para um endereço morto ficam sendo tentados por ~23 h.
