curl --request POST \
--url http://localhost:8000/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
"document.processing.completed",
"document.processing.failed"
],
"is_active": true,
"max_retries": 5,
"retry_enabled": true,
"url": "https://customer.com/webhooks/docintel"
}
'import requests
url = "http://localhost:8000/v1/webhooks"
payload = {
"events": ["document.processing.completed", "document.processing.failed"],
"is_active": True,
"max_retries": 5,
"retry_enabled": True,
"url": "https://customer.com/webhooks/docintel"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: ['document.processing.completed', 'document.processing.failed'],
is_active: true,
max_retries: 5,
retry_enabled: true,
url: 'https://customer.com/webhooks/docintel'
})
};
fetch('http://localhost:8000/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
'document.processing.completed',
'document.processing.failed'
],
'is_active' => true,
'max_retries' => 5,
'retry_enabled' => true,
'url' => 'https://customer.com/webhooks/docintel'
]),
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 := "http://localhost:8000/v1/webhooks"
payload := strings.NewReader("{\n \"events\": [\n \"document.processing.completed\",\n \"document.processing.failed\"\n ],\n \"is_active\": true,\n \"max_retries\": 5,\n \"retry_enabled\": true,\n \"url\": \"https://customer.com/webhooks/docintel\"\n}")
req, _ := http.NewRequest("POST", 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.post("http://localhost:8000/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n \"document.processing.completed\",\n \"document.processing.failed\"\n ],\n \"is_active\": true,\n \"max_retries\": 5,\n \"retry_enabled\": true,\n \"url\": \"https://customer.com/webhooks/docintel\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n \"document.processing.completed\",\n \"document.processing.failed\"\n ],\n \"is_active\": true,\n \"max_retries\": 5,\n \"retry_enabled\": true,\n \"url\": \"https://customer.com/webhooks/docintel\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2024-01-15T10:30:00Z",
"events": [
"document.processing.completed",
"document.processing.failed"
],
"is_active": true,
"max_retries": 5,
"retry_enabled": true,
"signing_secret": "whsec_abcdefghijklmnopqrstuvwxyz1234567890ABC",
"url": "https://customer.com/webhooks/docintel",
"webhook_config_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create webhook configuration
Create a new webhook endpoint configuration.
Creates a webhook with an auto-generated signing secret. The secret is returned only in this response - store it securely immediately.
curl --request POST \
--url http://localhost:8000/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
"document.processing.completed",
"document.processing.failed"
],
"is_active": true,
"max_retries": 5,
"retry_enabled": true,
"url": "https://customer.com/webhooks/docintel"
}
'import requests
url = "http://localhost:8000/v1/webhooks"
payload = {
"events": ["document.processing.completed", "document.processing.failed"],
"is_active": True,
"max_retries": 5,
"retry_enabled": True,
"url": "https://customer.com/webhooks/docintel"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: ['document.processing.completed', 'document.processing.failed'],
is_active: true,
max_retries: 5,
retry_enabled: true,
url: 'https://customer.com/webhooks/docintel'
})
};
fetch('http://localhost:8000/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'events' => [
'document.processing.completed',
'document.processing.failed'
],
'is_active' => true,
'max_retries' => 5,
'retry_enabled' => true,
'url' => 'https://customer.com/webhooks/docintel'
]),
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 := "http://localhost:8000/v1/webhooks"
payload := strings.NewReader("{\n \"events\": [\n \"document.processing.completed\",\n \"document.processing.failed\"\n ],\n \"is_active\": true,\n \"max_retries\": 5,\n \"retry_enabled\": true,\n \"url\": \"https://customer.com/webhooks/docintel\"\n}")
req, _ := http.NewRequest("POST", 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.post("http://localhost:8000/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n \"document.processing.completed\",\n \"document.processing.failed\"\n ],\n \"is_active\": true,\n \"max_retries\": 5,\n \"retry_enabled\": true,\n \"url\": \"https://customer.com/webhooks/docintel\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n \"document.processing.completed\",\n \"document.processing.failed\"\n ],\n \"is_active\": true,\n \"max_retries\": 5,\n \"retry_enabled\": true,\n \"url\": \"https://customer.com/webhooks/docintel\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2024-01-15T10:30:00Z",
"events": [
"document.processing.completed",
"document.processing.failed"
],
"is_active": true,
"max_retries": 5,
"retry_enabled": true,
"signing_secret": "whsec_abcdefghijklmnopqrstuvwxyz1234567890ABC",
"url": "https://customer.com/webhooks/docintel",
"webhook_config_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Body
Request schema for creating a webhook configuration (POST /v1/webhooks).
A cryptographically secure signing secret will be auto-generated. The secret is returned only in the creation response.
Configure webhook endpoints once and receive notifications for all subscribed events. This follows the Stripe/Clerk pattern for webhook management.
Attributes: url: HTTPS webhook endpoint URL events: List of event types to subscribe to (default: document.processing.completed, document.processing.failed) is_active: Whether the webhook is active (default: True) retry_enabled: Whether to retry failed deliveries (default: True) max_retries: Maximum retry attempts (default: 5)
Available Events: - document.uploaded: Document successfully uploaded and queued - document.processing.completed: Extraction completed successfully - document.processing.failed: Extraction failed with error
Response
New webhook config with signing secret
Response for newly created webhook configuration (includes signing secret).
WARNING: The signing_secret field is shown only in this response. Store it securely immediately - it cannot be retrieved again.
Available Events: - document.uploaded: Document successfully uploaded and queued - document.processing.completed: Extraction completed successfully - document.processing.failed: Extraction failed with error