Reenviar Evento de Webhook
curl --request POST \
--url https://garu.com.br/api/v1/webhook-events/{uuid}/retry \
--header 'Authorization: Bearer <token>'import requests
url = "https://garu.com.br/api/v1/webhook-events/{uuid}/retry"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://garu.com.br/api/v1/webhook-events/{uuid}/retry', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://garu.com.br/api/v1/webhook-events/{uuid}/retry",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://garu.com.br/api/v1/webhook-events/{uuid}/retry"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://garu.com.br/api/v1/webhook-events/{uuid}/retry")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://garu.com.br/api/v1/webhook-events/{uuid}/retry")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyWebhooks e Exemplos
Reenviar Evento de Webhook
Reseta um evento para pending e dispara a entrega imediatamente
POST
/
api
/
v1
/
webhook-events
/
{uuid}
/
retry
Reenviar Evento de Webhook
curl --request POST \
--url https://garu.com.br/api/v1/webhook-events/{uuid}/retry \
--header 'Authorization: Bearer <token>'import requests
url = "https://garu.com.br/api/v1/webhook-events/{uuid}/retry"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://garu.com.br/api/v1/webhook-events/{uuid}/retry', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://garu.com.br/api/v1/webhook-events/{uuid}/retry",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://garu.com.br/api/v1/webhook-events/{uuid}/retry"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://garu.com.br/api/v1/webhook-events/{uuid}/retry")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://garu.com.br/api/v1/webhook-events/{uuid}/retry")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyVisão Geral
Reseta o evento parapending, zera o contador de tentativas falhas e dispara a entrega imediatamente. Funciona em qualquer status (success, failed, pending).
Prefira
POST /webhook-events/:uuid/resend./retry muta o evento original — perde o histórico de tentativas e respostas — e manda o mesmo Idempotency-Key (payload.id) da entrega original, o que pode causar drop silencioso em receivers que deduplicam por header. /resend clona, preserva o original e usa Idempotency-Key: resend_<uuid>, sinalizando ao receiver que é entrega nova. Veja o guia Reenviar webhook para a comparação completa./retry segue funcionando para compatibilidade com automações existentes; ele não vai ser removido sem aviso.Rate limit: 20 requisições por minuto por IP. Para reprocessar lotes maiores, dê espaço entre as chamadas (≥ 3s entre retries) ou processe em batches de 20/min.
Exemplo de Requisição
curl -X POST https://garu.com.br/api/v1/webhook-events/a1b2c3d4-e5f6-7890-abcd-ef1234567890/retry \
-H "Authorization: Bearer sk_live_sua_chave_api"
import { Garu } from '@garuhq/node';
const garu = new Garu({ apiKey: process.env.GARU_API_KEY });
const reloaded = await garu.webhookEvents.retry('a1b2c3d4-e5f6-7890-abcd-ef1234567890');
console.log(reloaded.status); // → 'pending'
import os
import requests
response = requests.post(
"https://garu.com.br/api/v1/webhook-events/a1b2c3d4-e5f6-7890-abcd-ef1234567890/retry",
headers={"Authorization": f"Bearer {os.environ['GARU_API_KEY']}"},
)
print(response.json()["status"]) # → "pending"
Parâmetros de Path
string
required
UUID do evento a reenviar.
Resposta
Retorna oWebhookEvent atualizado, em 201 Created, já em pending:
{
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"webhookEndpoint": {
"id": 7,
"url": "https://example.com/webhooks/garu",
"description": "Produção",
"enabled": true,
"events": ["transaction.payment.succeeded"]
},
"eventType": "transaction.payment.succeeded",
"status": "pending",
"attempts": 0,
"lastAttemptAt": null,
"nextRetryAt": "2026-05-18T14:23:11.000Z",
"responseStatus": null,
"responseBody": null,
"manualResendOf": null,
"createdAt": "2026-05-18T14:22:00.000Z",
"payload": {
"id": "evt_1a2b3c",
"type": "transaction.payment.succeeded",
"data": { "object": { "id": 999, "value": 49.9 } }
}
}
Erros
| Status | Caso |
|---|---|
| 404 | Evento não existe ou não pertence ao seller chamando |
| 429 | Rate limit excedido (mais de 20 retries/min do mesmo IP) |
O que o reenvio faz
- Reseta o status para
pendinge zera tentativas falhas. - Reenvia o mesmo payload — o
iddo evento (evt_…) e o conteúdo do payload são preservados. Seu receiver recebe exatamente o que receberia na primeira tentativa. - Aplica a retry policy padrão caso a entrega falhe de novo (1min, 5min, 30min, 2h, 8h, 16h até
failedpermanente).
Como o
id do evento (evt_…) é o mesmo, sua lógica de idempotência no receiver deve tratar o reenvio como duplicata — é exatamente o que ela deveria fazer com qualquer redelivery automática da Garu.SDK, CLI e MCP
- Node SDK:
garu.webhookEvents.retry(uuid)— o parâmetro éuuida partir do@garuhq/node3.0.0 (eraidnumérico antes). - CLI:
garu webhooks events retry <uuid>— a partir do@garuhq/cli0.11.0. - MCP: ferramenta
retry_webhook_event(parâmetrouuid) — a partir do@garuhq/mcp0.21.0.
Was this page helpful?