Skip to main content
PATCH
/
webhooks
/
{id}
Update Webhook
curl --request PATCH \
  --url https://api.example.com/webhooks/{id} \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "url": "<string>",
  "events": [
    {}
  ],
  "name": "<string>",
  "description": "<string>",
  "headers": [
    {}
  ],
  "isActive": true
}
'
Updates an existing webhook configuration.

Overview

Update webhook settings including URL, subscribed events, custom headers, and active status. Only provided fields are updated; omitted fields remain unchanged.

Authentication

Authorization
string
required
Bearer token with write:webhooks scope

Path Parameters

id
string
required
The webhook configuration ID (UUID v4)

Request Body

All fields are optional. Only provided fields are updated.
url
string
The HTTPS endpoint URL to receive webhook notifications. Maximum 2048 characters.
events
array
Array of event type strings to subscribe to:
  • "analysis.completed" - Analysis finished successfully
  • "analysis.failed" - Analysis processing failed
  • "ping" - Test event for connectivity
  • "interview.completed" - Interview finished with analysis
  • "interview.failed" - Technical failure during interview
  • "interview.started" - Interview session began
name
string
Human-readable name for the webhook. Maximum 255 characters.
description
string
Description of what this webhook is used for.
headers
array
Custom headers to include in webhook requests. Maximum 50 headers.
This replaces all existing headers. Include all headers you want to keep.
isActive
boolean
Whether the webhook is active. Set to false to temporarily disable the webhook.

Response

Returns the updated webhook configuration.

Example Request

curl -X PATCH https://api.instaview.sk/webhooks/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer sk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://api.example.com/webhooks/instaview-v2",
    "events": ["analysis.completed", "analysis.failed", "interview.completed", "interview.failed"]
  }'

Example Response

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "apiKeyId": "api-key-uuid",
    "url": "https://api.example.com/webhooks/instaview-v2",
    "name": "Production Webhook",
    "description": "Receives interview completion notifications",
    "headers": [
      { "name": "Authorization", "isMasked": true }
    ],
    "events": [
      "analysis.completed",
      "analysis.failed",
      "interview.completed",
      "interview.failed"
    ],
    "isActive": true,
    "maxRetries": 3,
    "timeoutMs": 30000,
    "consecutiveFailures": 0,
    "circuitOpenedAt": null,
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-01-15T12:00:00Z"
  }
}

Common Update Scenarios

Disable Webhook Temporarily

await fetch(`https://api.instaview.sk/webhooks/${webhookId}`, {
  method: 'PATCH',
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    isActive: false
  })
});

Update Event Subscriptions

await fetch(`https://api.instaview.sk/webhooks/${webhookId}`, {
  method: 'PATCH',
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    events: ["analysis.completed", "analysis.failed", "ping", "interview.completed", "interview.failed", "interview.started"]
  })
});

Update Custom Headers

// Note: This replaces ALL headers
await fetch(`https://api.instaview.sk/webhooks/${webhookId}`, {
  method: 'PATCH',
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    headers: [
      { name: 'Authorization', value: 'Bearer new-token' },
      { name: 'X-Environment', value: 'production' }
    ]
  })
});

Error Responses

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "url must be a valid URL"
  }
}
{
  "success": false,
  "error": {
    "code": "RESOURCE_NOT_FOUND",
    "message": "Webhook configuration not found"
  }
}
{
  "success": false,
  "error": {
    "code": "RESOURCE_ACCESS_DENIED",
    "message": "Access denied to this webhook configuration"
  }
}