Replay Webhook Delivery
curl --request POST \
--url https://app.tuco.ai/api/webhooks/{id}/deliveries/{deliveryId}/replay \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.tuco.ai/api/webhooks/{id}/deliveries/{deliveryId}/replay"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.tuco.ai/api/webhooks/{id}/deliveries/{deliveryId}/replay', 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://app.tuco.ai/api/webhooks/{id}/deliveries/{deliveryId}/replay",
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://app.tuco.ai/api/webhooks/{id}/deliveries/{deliveryId}/replay"
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://app.tuco.ai/api/webhooks/{id}/deliveries/{deliveryId}/replay")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tuco.ai/api/webhooks/{id}/deliveries/{deliveryId}/replay")
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_body{
"success": true,
"deliveryId": "<string>",
"isReplayOf": "<string>",
"responseStatus": {},
"error": {},
"latencyMs": 123,
"attemptCount": 123
}Webhooks
Replay Webhook Delivery
Re-send a past webhook delivery to your endpoint: the exact same body, signed with your current secret, to your current URL.
POST
/
api
/
webhooks
/
{id}
/
deliveries
/
{deliveryId}
/
replay
Replay Webhook Delivery
curl --request POST \
--url https://app.tuco.ai/api/webhooks/{id}/deliveries/{deliveryId}/replay \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.tuco.ai/api/webhooks/{id}/deliveries/{deliveryId}/replay"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.tuco.ai/api/webhooks/{id}/deliveries/{deliveryId}/replay', 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://app.tuco.ai/api/webhooks/{id}/deliveries/{deliveryId}/replay",
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://app.tuco.ai/api/webhooks/{id}/deliveries/{deliveryId}/replay"
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://app.tuco.ai/api/webhooks/{id}/deliveries/{deliveryId}/replay")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tuco.ai/api/webhooks/{id}/deliveries/{deliveryId}/replay")
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_body{
"success": true,
"deliveryId": "<string>",
"isReplayOf": "<string>",
"responseStatus": {},
"error": {},
"latencyMs": 123,
"attemptCount": 123
}Re-sends the stored request body byte for byte to the webhook’s current URL, signed with the webhook’s current secret. Use it after fixing an endpoint that was down.
The replay carries the original
X-Tuco-Event-Id (so you can tell it is the same event), a new X-Tuco-Delivery-Id, and X-Tuco-Replay: true. It is recorded as a new delivery with isReplayOf pointing at the original. Replaying a replay points at the original too.
Authentication
Authorization: Bearer tuco_xxxxxxxxxxxxx
Path parameters
string
required
Webhook ID.
string
required
Delivery
id to re-send.Response
boolean
Your endpoint returned 2xx.
string
Id of the new delivery record.
string
Id of the original delivery.
number | null
Your endpoint’s HTTP status.
string | null
Why it failed.
number
Total time including any retry.
number
1 or 2.
| Status | When |
|---|---|
200 | Replayed and your endpoint returned 2xx |
502 | Replayed, but your endpoint did not return 2xx |
401 | Missing or invalid API key |
402 | Workspace is read-only (billing) |
404 | Webhook or delivery not found in your workspace |
409 | Webhook is inactive. Activate it first. |
Example
curl -X POST "https://app.tuco.ai/api/webhooks/680a1b2c3d4e5f6789012345/deliveries/6ad14a1e2f9c4b0012ab34cd/replay" \
-H "Authorization: Bearer tuco_xxxxxxxxxxxxx"
{
"success": true,
"deliveryId": "6ad14b9a2f9c4b0012ab34d1",
"isReplayOf": "6ad14a1e2f9c4b0012ab34cd",
"responseStatus": 200,
"error": null,
"latencyMs": 184,
"attemptCount": 1
}