Update webhook
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",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"param": "patient.date_of_birth",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#validation_error"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"param": "patient.date_of_birth",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#validation_error"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"param": "patient.date_of_birth",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#validation_error"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"param": "patient.date_of_birth",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#validation_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#internal_error"
}
}Webhooks
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.
PATCH
/
v2
/
webhooks
/
{id}
Update webhook
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",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"param": "patient.date_of_birth",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#validation_error"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"param": "patient.date_of_birth",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#validation_error"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"param": "patient.date_of_birth",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#validation_error"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"param": "patient.date_of_birth",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#validation_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#internal_error"
}
}Authorizations
API key authentication. Use format: Authorization: Bearer tavrn_sk_live_... Live keys (tavrn_sk_live_...) work only against https://enterprise.tavrn.ai; sandbox test keys (tavrn_sk_test_..., from https://sandbox.tavrn.ai) work only against https://sandbox.tavrn.ai.
Headers
Body
application/json
Event types to subscribe to
Minimum array length:
1Available options:
retrieval_request.status_changed, retrieval_request.action_required, retrieval_request.documents_available, retrieval_request.updated, retrieval_request_draft.created, retrieval_request_draft.submitted, retrieval_request_draft.deleted, webhook_endpoint.disabled Response
Webhook updated successfully
Subscribed event types. New and updated subscriptions require at least one event.
Available options:
retrieval_request.status_changed, retrieval_request.action_required, retrieval_request.documents_available, retrieval_request.updated, retrieval_request_draft.created, retrieval_request_draft.submitted, retrieval_request_draft.deleted, webhook_endpoint.disabled Example:
[
"retrieval_request.status_changed",
"retrieval_request.documents_available"
]