Update Webhook Endpoint
curl --request PATCH \
--url https://api.bunship.com/api/v1/organizations/{orgId}/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"description": "<string>",
"events": [
"<string>"
],
"isActive": true
}
'import requests
url = "https://api.bunship.com/api/v1/organizations/{orgId}/webhooks/{id}"
payload = {
"url": "<string>",
"description": "<string>",
"events": ["<string>"],
"isActive": 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({url: '<string>', description: '<string>', events: ['<string>'], isActive: true})
};
fetch('https://api.bunship.com/api/v1/organizations/{orgId}/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.bunship.com/api/v1/organizations/{orgId}/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([
'url' => '<string>',
'description' => '<string>',
'events' => [
'<string>'
],
'isActive' => 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://api.bunship.com/api/v1/organizations/{orgId}/webhooks/{id}"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"description\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"isActive\": 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://api.bunship.com/api/v1/organizations/{orgId}/webhooks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"description\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"isActive\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunship.com/api/v1/organizations/{orgId}/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 \"url\": \"<string>\",\n \"description\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"isActive\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "wh_abc123",
"organizationId": "org_cld2abc123def456",
"url": "https://example.com/webhooks/bunship-v2",
"description": "Updated webhook handler",
"events": ["member.added", "member.removed", "subscription.updated"],
"isActive": true,
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-21T09:00:00Z"
}
}
Webhooks
Update Webhook Endpoint
Update an existing webhook endpoint
PATCH
/
api
/
v1
/
organizations
/
{orgId}
/
webhooks
/
{id}
Update Webhook Endpoint
curl --request PATCH \
--url https://api.bunship.com/api/v1/organizations/{orgId}/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"description": "<string>",
"events": [
"<string>"
],
"isActive": true
}
'import requests
url = "https://api.bunship.com/api/v1/organizations/{orgId}/webhooks/{id}"
payload = {
"url": "<string>",
"description": "<string>",
"events": ["<string>"],
"isActive": 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({url: '<string>', description: '<string>', events: ['<string>'], isActive: true})
};
fetch('https://api.bunship.com/api/v1/organizations/{orgId}/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.bunship.com/api/v1/organizations/{orgId}/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([
'url' => '<string>',
'description' => '<string>',
'events' => [
'<string>'
],
'isActive' => 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://api.bunship.com/api/v1/organizations/{orgId}/webhooks/{id}"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"description\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"isActive\": 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://api.bunship.com/api/v1/organizations/{orgId}/webhooks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"description\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"isActive\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunship.com/api/v1/organizations/{orgId}/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 \"url\": \"<string>\",\n \"description\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"isActive\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "wh_abc123",
"organizationId": "org_cld2abc123def456",
"url": "https://example.com/webhooks/bunship-v2",
"description": "Updated webhook handler",
"events": ["member.added", "member.removed", "subscription.updated"],
"isActive": true,
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-21T09:00:00Z"
}
}
Updates an existing webhook endpoint’s configuration. Only included fields are modified.
Auth
Requires a valid Bearer token. User must be a member of the organization.
Path Parameters
Organization identifier.
Webhook endpoint identifier.
Request Body
All fields are optional.Updated webhook delivery URL. Must be a valid HTTPS URI.
Updated description.
Updated list of subscribed event types.
Set to
false to pause deliveries, true to resume.Response
Returns the updated webhook endpoint object.{
"success": true,
"data": {
"id": "wh_abc123",
"organizationId": "org_cld2abc123def456",
"url": "https://example.com/webhooks/bunship-v2",
"description": "Updated webhook handler",
"events": ["member.added", "member.removed", "subscription.updated"],
"isActive": true,
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-21T09:00:00Z"
}
}
Example
curl -X PATCH https://api.bunship.com/api/v1/organizations/org_cld2abc123def456/webhooks/wh_abc123 \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/webhooks/bunship-v2",
"events": ["member.added", "member.removed", "subscription.updated"]
}'
⌘I

