Update Webhook Configuration
curl --request PUT \
--url https://api.example.com/api/v1/public/webhooks \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"webhookConfig": {
"url": "<string>"
},
"inboundWebhookConfig": {
"url": "<string>"
}
}
'import requests
url = "https://api.example.com/api/v1/public/webhooks"
payload = {
"webhookConfig": { "url": "<string>" },
"inboundWebhookConfig": { "url": "<string>" }
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({webhookConfig: {url: '<string>'}, inboundWebhookConfig: {url: '<string>'}})
};
fetch('https://api.example.com/api/v1/public/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_URL => "https://api.example.com/api/v1/public/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'webhookConfig' => [
'url' => '<string>'
],
'inboundWebhookConfig' => [
'url' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://api.example.com/api/v1/public/webhooks"
payload := strings.NewReader("{\n \"webhookConfig\": {\n \"url\": \"<string>\"\n },\n \"inboundWebhookConfig\": {\n \"url\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.put("https://api.example.com/api/v1/public/webhooks")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"webhookConfig\": {\n \"url\": \"<string>\"\n },\n \"inboundWebhookConfig\": {\n \"url\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/public/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"webhookConfig\": {\n \"url\": \"<string>\"\n },\n \"inboundWebhookConfig\": {\n \"url\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_bodyWebhook APIs
Update Webhook Configuration
Configure webhook endpoints for receiving notification events from Siren
PUT
/
api
/
v1
/
public
/
webhooks
Update Webhook Configuration
curl --request PUT \
--url https://api.example.com/api/v1/public/webhooks \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"webhookConfig": {
"url": "<string>"
},
"inboundWebhookConfig": {
"url": "<string>"
}
}
'import requests
url = "https://api.example.com/api/v1/public/webhooks"
payload = {
"webhookConfig": { "url": "<string>" },
"inboundWebhookConfig": { "url": "<string>" }
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({webhookConfig: {url: '<string>'}, inboundWebhookConfig: {url: '<string>'}})
};
fetch('https://api.example.com/api/v1/public/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_URL => "https://api.example.com/api/v1/public/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'webhookConfig' => [
'url' => '<string>'
],
'inboundWebhookConfig' => [
'url' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://api.example.com/api/v1/public/webhooks"
payload := strings.NewReader("{\n \"webhookConfig\": {\n \"url\": \"<string>\"\n },\n \"inboundWebhookConfig\": {\n \"url\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.put("https://api.example.com/api/v1/public/webhooks")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"webhookConfig\": {\n \"url\": \"<string>\"\n },\n \"inboundWebhookConfig\": {\n \"url\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/public/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"webhookConfig\": {\n \"url\": \"<string>\"\n },\n \"inboundWebhookConfig\": {\n \"url\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_bodyHeader
string
required
Request Body
{
"webhookConfig": {
"url": "https://your-webhook-url.com/notifications"
},
"inboundWebhookConfig": {
"url": "https://your-webhook-url.com/inbound"
}
}
Request Fields
webhookConfig (Optional)
object
Configuration for notification webhook
string
required
The URL where notification events will be sent
inboundWebhookConfig (Optional)
object
Configuration for inbound message webhook
string
required
The URL where inbound messages will be sent
Example: cURL Request
curl --location --request PUT 'https://api.trysiren.io/api/v1/public/webhooks' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer your-access-token' \
--data-raw '{
"webhookConfig": {
"url": "https://your-webhook-url.com/notifications"
},
"inboundWebhookConfig": {
"url": "https://your-webhook-url.com/inbound"
}
}'
Response
Success Response (200 OK)
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"environment": "PRODUCTION",
"webhookConfig": {
"url": "https://your-webhook-url.com/notifications",
"headers": [
{
"name": "Custom-Header",
"value": "custom-value"
}
],
"verificationKey": "webhook-secret-key"
},
"inboundWebhookConfig": {
"url": "https://your-webhook-url.com/inbound",
"headers": [],
"verificationKey": "inbound-secret-key"
}
}
Webhook Payloads
Notification Webhook Payload
When a notification event occurs, Siren will send a POST request to the configured webhook URL with the following payload structure:{
"event": "notification.status.updated",
"timestamp": "2023-01-01T12:00:00Z",
"data": {
"notificationId": "123e4567-e89b-12d3-a456-426614174000",
"status": "delivered",
"channel": "email",
"recipient": "user@example.com",
"metadata": {
"workflowId": "w-1234567890",
"templateId": "tpl-1234567890"
}
}
}
Webhook Headers
Each webhook request will include the following headers:x-siren-webhook-signature: A signature you can use to verify the webhook’s authenticity.Content-Type:application/json(set by HTTP client)- Any custom headers configured in your webhook configuration.
Error Responses
400 Bad Request
{
"success": false,
"message": "Invalid request body",
"errors": [
"At least one of webhookConfig or inboundWebhookConfig must be provided"
]
}
401 Unauthorized
{
"success": false,
"message": "Unauthorized",
"error": "Invalid or missing authentication token"
}
Best Practices
- Always verify the
X-Siren-Signatureheader to ensure the webhook is from Siren. - Implement retry logic for handling failed webhook deliveries.
- Set up appropriate rate limiting on your webhook endpoint.
- Keep your webhook URL secure and never expose it in client-side code.
- Handle duplicate events by checking the
X-Siren-Deliveryheader.
Was this page helpful?