POST/v1/webhooks/{id}/test
Send a sample event to a webhook now and see what it answered
The sample record has test: true and costs nothing; event picks which kind (default render.completed). The response says whether the URL answered 2xx, its status (0 when it never answered) and how long it took.
PARAMETERS
- idpath · stringREQUIRED
- The webhook ide.g. hook_8m3kq2xv7zpw4rcn6bdt
REQUEST BODY · APPLICATION/JSON
{
"event": "video.completed"
}
REQUEST
curl -X POST "https://api.imageapis.com/v1/webhooks/hook_8m3kq2xv7zpw4rcn6bdt/test" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": "video.completed"
}'
import requests
r = requests.post("https://api.imageapis.com/v1/webhooks/hook_8m3kq2xv7zpw4rcn6bdt/test", headers={"X-API-Key": "YOUR_KEY"}, json={
"event": "video.completed"
})
print(r.status_code, r.headers.get("X-Gw-Remaining"))
print(r.json())
const r = await fetch("https://api.imageapis.com/v1/webhooks/hook_8m3kq2xv7zpw4rcn6bdt/test", {
method: "POST",
headers: { "X-API-Key": "YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
"event": "video.completed"
})
});
console.log(r.status, r.headers.get("X-Gw-Remaining"));
console.log(await r.json());
RESPONSE
200OK
{
"webhook": "hook_8m3kq2xv7zpw4rcn6bdt",
"url": "https://example.com/hooks/imageapis",
"delivered": true,
"status": 200,
"ms": 164
}
401Missing or invalid API key (from the gateway)
404No such template or record on this account
{
"error": "string",
"message": "string",
"param": "string"
}