Reset Circuit Breaker
curl --request POST \
--url https://api.example.com/webhooks/{id}/reset-circuit \
--header 'Authorization: <authorization>'import requests
url = "https://api.example.com/webhooks/{id}/reset-circuit"
headers = {"Authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<authorization>'}};
fetch('https://api.example.com/webhooks/{id}/reset-circuit', 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://api.example.com/webhooks/{id}/reset-circuit",
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: <authorization>"
],
]);
$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://api.example.com/webhooks/{id}/reset-circuit"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/webhooks/{id}/reset-circuit")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/webhooks/{id}/reset-circuit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"consecutiveFailures": 123,
"circuitOpenedAt": "<string>",
"isActive": true
}Webhooks
Reset Circuit Breaker
POST
/
webhooks
/
{id}
/
reset-circuit
Reset Circuit Breaker
curl --request POST \
--url https://api.example.com/webhooks/{id}/reset-circuit \
--header 'Authorization: <authorization>'import requests
url = "https://api.example.com/webhooks/{id}/reset-circuit"
headers = {"Authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<authorization>'}};
fetch('https://api.example.com/webhooks/{id}/reset-circuit', 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://api.example.com/webhooks/{id}/reset-circuit",
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: <authorization>"
],
]);
$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://api.example.com/webhooks/{id}/reset-circuit"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/webhooks/{id}/reset-circuit")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/webhooks/{id}/reset-circuit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"consecutiveFailures": 123,
"circuitOpenedAt": "<string>",
"isActive": true
}Resets the circuit breaker for a webhook that was automatically disabled due to consecutive failures.
Overview
When a webhook experiences too many consecutive delivery failures, the circuit breaker automatically opens to prevent further attempts. This endpoint allows you to reset the circuit breaker and re-enable the webhook after you’ve fixed the underlying issue.Authentication
string
required
Bearer token with
write:webhooks scopePath Parameters
string
required
The webhook configuration ID (UUID v4)
Response
Returns the updated webhook configuration with reset circuit breaker state.number
Reset to 0
string
Reset to null
boolean
Re-enabled (true)
Example Request
curl -X POST https://api.instaview.sk/webhooks/550e8400-e29b-41d4-a716-446655440000/reset-circuit \
-H "Authorization: Bearer sk_your_key_here"
const webhookId = '550e8400-e29b-41d4-a716-446655440000';
const response = await fetch(
`https://api.instaview.sk/webhooks/${webhookId}/reset-circuit`,
{
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.INSTAVIEW_API_KEY}`
}
}
);
const data = await response.json();
console.log(`Circuit reset. Active: ${data.isActive}`);
console.log(`Consecutive failures: ${data.consecutiveFailures}`);
webhook_id = '550e8400-e29b-41d4-a716-446655440000'
response = requests.post(
f'https://api.instaview.sk/webhooks/{webhook_id}/reset-circuit',
headers={
'Authorization': f'Bearer {os.environ["INSTAVIEW_API_KEY"]}'
}
)
data = response.json()
print(f'Circuit reset. Active: {data["isActive"]}')
print(f'Consecutive failures: {data["consecutiveFailures"]}')
Example Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"apiKeyId": "api-key-uuid",
"url": "https://api.example.com/webhooks/instaview",
"name": "Production Webhook",
"description": "Receives conversation completion notifications",
"headers": [
{
"name": "Authorization",
"isMasked": true
}
],
"events": [
"conversation.completed",
"analysis.completed"
],
"vocabulary": "NEUTRAL",
"isActive": true,
"maxRetries": 3,
"timeoutMs": 30000,
"consecutiveFailures": 0,
"circuitOpenedAt": null,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-16T09:00:00Z"
}
Circuit Breaker Workflow
1
Identify Problem
Check
consecutiveFailures and circuitOpenedAt to confirm circuit is open2
Fix Issue
Resolve the underlying problem (endpoint availability, authentication, etc.)
3
Test Endpoint
Use the test endpoint to verify connectivity
4
Reset Circuit
Call this endpoint to re-enable the webhook
5
Monitor
Watch for new failures after reset
Recommended Reset Procedure
async function safeResetCircuit(webhookId) {
// 1. Check current state
const { data: webhook } = await getWebhook(webhookId);
if (!webhook.circuitOpenedAt) {
console.log('Circuit is not open, no reset needed');
return webhook;
}
console.log(`Circuit has been open since: ${webhook.circuitOpenedAt}`);
console.log(`Consecutive failures: ${webhook.consecutiveFailures}`);
// 2. Ensure webhook has ping event for testing
if (!webhook.events.includes('ping')) {
console.log('Adding ping event for testing...');
await updateWebhook(webhookId, {
events: [...webhook.events, 'ping']
});
}
// 3. Test connectivity first
console.log('Testing webhook connectivity...');
const testResult = await testWebhook(webhookId);
if (!testResult.success) {
console.error('Webhook test failed:', testResult.message);
console.error('Fix the issue before resetting circuit');
return null;
}
console.log('Webhook test successful');
// 4. Reset circuit
console.log('Resetting circuit breaker...');
const { data: resetWebhook } = await resetCircuit(webhookId);
console.log(`Circuit reset. Webhook is now active: ${resetWebhook.isActive}`);
return resetWebhook;
}
Common Causes of Circuit Breaker Trips
Endpoint unavailable
Endpoint unavailable
- Server crashed or was redeployed
- DNS resolution failed
- Network connectivity issues
Authentication failures
Authentication failures
- API token expired
- Custom header value changed
- Authentication endpoint down
Timeout issues
Timeout issues
- Endpoint taking too long to respond
- Long-running synchronous processing
- Network latency
Response errors
Response errors
- Application errors (5xx)
- Validation failures (4xx)
- Incorrect response format
Error Responses
404 - Webhook Not Found
404 - Webhook Not Found
{
"statusCode": 404,
"message": "Webhook configuration not found",
"traceId": "4b1f0c9d2e6a47f8b3c5d7e9a1b2c3d4",
"timestamp": "2026-08-03T10:30:00.000Z"
}
403 - Access Denied
403 - Access Denied
{
"statusCode": 403,
"message": "Access denied to this webhook configuration",
"traceId": "4b1f0c9d2e6a47f8b3c5d7e9a1b2c3d4",
"timestamp": "2026-08-03T10:30:00.000Z"
}
Related
Test Webhook
Test connectivity before resetting
Get Webhook
Check circuit breaker status