curl --request PATCH \
--url https://enterprise.tavrn.ai/v2/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Production webhook",
"url": "<string>",
"events": [],
"description": "<string>",
"is_enabled": true
}
'import requests
url = "https://enterprise.tavrn.ai/v2/webhooks/{id}"
payload = {
"name": "Production webhook",
"url": "<string>",
"events": [],
"description": "<string>",
"is_enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Production webhook',
url: '<string>',
events: [],
description: '<string>',
is_enabled: true
})
};
fetch('https://enterprise.tavrn.ai/v2/webhooks/{id}', 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://enterprise.tavrn.ai/v2/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Production webhook',
'url' => '<string>',
'events' => [
],
'description' => '<string>',
'is_enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://enterprise.tavrn.ai/v2/webhooks/{id}"
payload := strings.NewReader("{\n \"name\": \"Production webhook\",\n \"url\": \"<string>\",\n \"events\": [],\n \"description\": \"<string>\",\n \"is_enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://enterprise.tavrn.ai/v2/webhooks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Production webhook\",\n \"url\": \"<string>\",\n \"events\": [],\n \"description\": \"<string>\",\n \"is_enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://enterprise.tavrn.ai/v2/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Production webhook\",\n \"url\": \"<string>\",\n \"events\": [],\n \"description\": \"<string>\",\n \"is_enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "507f1f77bcf86cd799439016",
"name": "Production webhook",
"url": "https://client.example.com/webhooks/tavrn",
"events": [
"retrieval_request.status_changed",
"retrieval_request.documents_available"
],
"description": "Production webhook for retrieval events",
"is_enabled": true,
"consecutive_failures": 0,
"last_failure_at": "2023-11-07T05:31:56Z",
"last_success_at": "2023-11-07T05:31:56Z",
"auto_disabled_at": "2023-11-07T05:31:56Z",
"last_failure": {
"at": "2026-10-07T17:30:00.000Z",
"status_code": 502,
"error": "HTTP 502",
"event_type": "retrieval_request.status_changed"
},
"secret_hint": "...Ab12",
"created_by": "<string>",
"created_at": "2025-02-01T12:34:56Z",
"updated_at": "2025-02-01T12:34:56Z"
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required"
}
}Update webhook
Update webhook configuration. Requires webhooks:write; setting retrieval events or re-enabling a retrieval subscription also requires retrievals:read. Re-enabling clears auto_disabled_at and resets consecutive_failures.
curl --request PATCH \
--url https://enterprise.tavrn.ai/v2/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Production webhook",
"url": "<string>",
"events": [],
"description": "<string>",
"is_enabled": true
}
'import requests
url = "https://enterprise.tavrn.ai/v2/webhooks/{id}"
payload = {
"name": "Production webhook",
"url": "<string>",
"events": [],
"description": "<string>",
"is_enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Production webhook',
url: '<string>',
events: [],
description: '<string>',
is_enabled: true
})
};
fetch('https://enterprise.tavrn.ai/v2/webhooks/{id}', 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://enterprise.tavrn.ai/v2/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Production webhook',
'url' => '<string>',
'events' => [
],
'description' => '<string>',
'is_enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://enterprise.tavrn.ai/v2/webhooks/{id}"
payload := strings.NewReader("{\n \"name\": \"Production webhook\",\n \"url\": \"<string>\",\n \"events\": [],\n \"description\": \"<string>\",\n \"is_enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://enterprise.tavrn.ai/v2/webhooks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Production webhook\",\n \"url\": \"<string>\",\n \"events\": [],\n \"description\": \"<string>\",\n \"is_enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://enterprise.tavrn.ai/v2/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Production webhook\",\n \"url\": \"<string>\",\n \"events\": [],\n \"description\": \"<string>\",\n \"is_enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "507f1f77bcf86cd799439016",
"name": "Production webhook",
"url": "https://client.example.com/webhooks/tavrn",
"events": [
"retrieval_request.status_changed",
"retrieval_request.documents_available"
],
"description": "Production webhook for retrieval events",
"is_enabled": true,
"consecutive_failures": 0,
"last_failure_at": "2023-11-07T05:31:56Z",
"last_success_at": "2023-11-07T05:31:56Z",
"auto_disabled_at": "2023-11-07T05:31:56Z",
"last_failure": {
"at": "2026-10-07T17:30:00.000Z",
"status_code": 502,
"error": "HTTP 502",
"event_type": "retrieval_request.status_changed"
},
"secret_hint": "...Ab12",
"created_by": "<string>",
"created_at": "2025-02-01T12:34:56Z",
"updated_at": "2025-02-01T12:34:56Z"
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required"
}
}Authorizations
API key authentication. Use format: Authorization: Bearer tavrn_sk_live_...
Path Parameters
Webhook ID
Body
Webhook name, unique within your organization
1 - 100"Production webhook"
Webhook endpoint URL (must use HTTP/HTTPS)
2048Event types to subscribe to
1retrieval_request.status_changed, retrieval_request.action_required, retrieval_request.documents_available Optional webhook description
500Enable or disable webhook
Response
Webhook updated successfully
Opaque webhook identifier.
"507f1f77bcf86cd799439016"
Webhook name, unique within your organization
"Production webhook"
Webhook endpoint URL (must use HTTP/HTTPS)
"https://client.example.com/webhooks/tavrn"
Subscribed event types. New and updated subscriptions require at least one event.
retrieval_request.status_changed, retrieval_request.action_required, retrieval_request.documents_available [
"retrieval_request.status_changed",
"retrieval_request.documents_available"
]
Optional webhook description
"Production webhook for retrieval events"
Whether webhook is enabled
true
Count of consecutive events that failed after all delivery attempts
0
Last event that failed after all delivery attempts (ISO 8601), or null
Last successful event delivery (ISO 8601), or null
When Tavrn automatically disabled this webhook after 5 consecutive failed deliveries (ISO 8601), or null. Cleared when you set is_enabled to true.
Most recent unsuccessful delivery attempt, or null. Test events are excluded.
Show child attributes
Show child attributes
Last 4 characters of webhook secret (for identification)
"...Ab12"
User or API key that created the webhook
Creation timestamp (ISO 8601)
"2025-02-01T12:34:56Z"
Last update timestamp (ISO 8601)
"2025-02-01T12:34:56Z"