Update Webhook Endpoint
curl --request PUT \
--url https://api.example.com/v1/webhooks/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"name": "<string>",
"url": "<string>",
"event_types": [
{}
],
"is_active": true,
"metadata": {}
}
'import requests
url = "https://api.example.com/v1/webhooks/{id}"
payload = {
"name": "<string>",
"url": "<string>",
"event_types": [{}],
"is_active": True,
"metadata": {}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
name: '<string>',
url: '<string>',
event_types: [{}],
is_active: true,
metadata: {}
})
};
fetch('https://api.example.com/v1/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://api.example.com/v1/webhooks/{id}",
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([
'name' => '<string>',
'url' => '<string>',
'event_types' => [
[
]
],
'is_active' => true,
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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/v1/webhooks/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"event_types\": [\n {}\n ],\n \"is_active\": true,\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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/v1/webhooks/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"event_types\": [\n {}\n ],\n \"is_active\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"event_types\": [\n {}\n ],\n \"is_active\": true,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"tenant": "partner-name",
"name": "Updated Webhook Name",
"url": "https://api.partner.com/webhooks/new",
"apiKey": "whk_****...****5678",
"eventTypes": ["kyc.status.changed", "card.activated"],
"isActive": true,
"metadata": {},
"createdAt": "2025-12-29T10:00:00.000Z",
"updatedAt": "2025-12-29T12:30:00.000Z"
}
}
Webhooks
Update Webhook Endpoint
Update an existing webhook configuration
PUT
/
v1
/
webhooks
/
{id}
Update Webhook Endpoint
curl --request PUT \
--url https://api.example.com/v1/webhooks/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"name": "<string>",
"url": "<string>",
"event_types": [
{}
],
"is_active": true,
"metadata": {}
}
'import requests
url = "https://api.example.com/v1/webhooks/{id}"
payload = {
"name": "<string>",
"url": "<string>",
"event_types": [{}],
"is_active": True,
"metadata": {}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
name: '<string>',
url: '<string>',
event_types: [{}],
is_active: true,
metadata: {}
})
};
fetch('https://api.example.com/v1/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://api.example.com/v1/webhooks/{id}",
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([
'name' => '<string>',
'url' => '<string>',
'event_types' => [
[
]
],
'is_active' => true,
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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/v1/webhooks/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"event_types\": [\n {}\n ],\n \"is_active\": true,\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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/v1/webhooks/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"event_types\": [\n {}\n ],\n \"is_active\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"event_types\": [\n {}\n ],\n \"is_active\": true,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"tenant": "partner-name",
"name": "Updated Webhook Name",
"url": "https://api.partner.com/webhooks/new",
"apiKey": "whk_****...****5678",
"eventTypes": ["kyc.status.changed", "card.activated"],
"isActive": true,
"metadata": {},
"createdAt": "2025-12-29T10:00:00.000Z",
"updatedAt": "2025-12-29T12:30:00.000Z"
}
}
Update Webhook Endpoint
PUT https://api.baanx.com/v1/webhooks/{id} Updates an existing webhook configuration.Overview
All fields are optional — only provide the fields you want to change. The response returns the full updated webhook configuration with a masked API key.To change the API key used for signature verification, use the Rotate Key endpoint instead.
Authentication
This endpoint requires authentication via Bearer token:Authorization: Bearer YOUR_ACCESS_TOKEN
Request
Headers
Path Parameters
Body
All body fields are optional. Only include the fields you wish to update.New list of event type strings. Replaces the existing list. Must contain at least one item if provided.
Request Examples
curl -X PUT https://api.baanx.com/v1/webhooks/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"is_active": true
}'
curl -X PUT https://api.baanx.com/v1/webhooks/550e8400-e29b-41d4-a716-446655440000 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://api.partner.com/webhooks/v2/events"
}'
const webhookId = '550e8400-e29b-41d4-a716-446655440000';
const response = await fetch(`https://api.baanx.com/v1/webhooks/${webhookId}`, {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Updated Webhook Name',
url: 'https://api.partner.com/webhooks/new',
event_types: ['kyc.status.changed', 'card.activated'],
is_active: true
})
});
const data = await response.json();
console.log(data);
import requests
webhook_id = "550e8400-e29b-41d4-a716-446655440000"
url = f"https://api.baanx.com/v1/webhooks/{webhook_id}"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
payload = {
"is_active": True
}
response = requests.put(url, headers=headers, json=payload)
print(response.json())
interface UpdateWebhookRequest {
name?: string;
url?: string;
event_types?: string[];
is_active?: boolean;
metadata?: Record<string, unknown>;
}
const updateWebhook = async (webhookId: string, updates: UpdateWebhookRequest) => {
const response = await fetch(`https://api.baanx.com/v1/webhooks/${webhookId}`, {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify(updates)
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return await response.json();
};
Response
200 Success
The full updated webhook configuration with masked API key. See Get Webhook for field descriptions.
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"tenant": "partner-name",
"name": "Updated Webhook Name",
"url": "https://api.partner.com/webhooks/new",
"apiKey": "whk_****...****5678",
"eventTypes": ["kyc.status.changed", "card.activated"],
"isActive": true,
"metadata": {},
"createdAt": "2025-12-29T10:00:00.000Z",
"updatedAt": "2025-12-29T12:30:00.000Z"
}
}
Error Responses
{
"message": "url must be an HTTPS URL"
}
{
"message": "Not authenticated"
}
{
"message": "Not authorized"
}
{
"message": "Webhook config not found"
}
{
"message": "Notification service is not configured for this environment"
}
Related Endpoints
GET /v1/webhooks/{id}- Get current webhook configurationPOST /v1/webhooks/{id}/rotate-key- Rotate the signing API keyDELETE /v1/webhooks/{id}- Delete this webhook
Was this page helpful?