Update an endpoint
curl --request PATCH \
--url https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks/{receiverId}/endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/nowbookit",
"isActive": false
}
'import requests
url = "https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks/{receiverId}/endpoints"
payload = {
"url": "https://example.com/nowbookit",
"isActive": False
}
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: 'https://example.com/nowbookit', isActive: false})
};
fetch('https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks/{receiverId}/endpoints', 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://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks/{receiverId}/endpoints",
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' => 'https://example.com/nowbookit',
'isActive' => false
]),
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://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks/{receiverId}/endpoints"
payload := strings.NewReader("{\n \"url\": \"https://example.com/nowbookit\",\n \"isActive\": false\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://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks/{receiverId}/endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/nowbookit\",\n \"isActive\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks/{receiverId}/endpoints")
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\": \"https://example.com/nowbookit\",\n \"isActive\": false\n}"
response = http.request(request)
puts response.read_body{
"webhook": {
"receiverId": "3f2b8c1e-6d4a-4f1b-9a7e-2c5d8e9f0a1b",
"orgId": "org_01HXYZEXAMPLE",
"scope": "venues",
"name": "Your integration",
"outputFormat": "standard",
"createdByIntegrationId": "your-integration-id",
"venues": [
{
"venueId": "6319",
"secretLast4": "Q2xY"
}
],
"endpoints": [
{
"url": "https://example.com/nowbookit",
"eventTypes": [
"booking.created",
"booking.updated",
"booking.cancelled"
],
"isActive": true
}
]
}
}{
"code": "ValidationError",
"message": "Request body failed validation",
"requestId": "8f14e45f-ceea-4c6f-8f89-example",
"errors": {
"events": [
"Too small: expected array to have >=1 items"
]
}
}{
"code": "UnauthorisedError",
"message": "Invalid API key",
"requestId": "8f14e45f-ceea-4c6f-8f89-example"
}{
"code": "AppError",
"message": "Only an API key for this venue can manage its webhooks.",
"requestId": "8f14e45f-ceea-4c6f-8f89-example"
}{
"code": "AppError",
"message": "This webhook doesn't send to that URL.",
"requestId": "8f14e45f-ceea-4c6f-8f89-example"
}Webhooks
Update an Endpoint
Change an endpoint’s events, or switch it off and on.
PATCH
/
venue
/
{venueId}
/
webhooks
/
{receiverId}
/
endpoints
Update an endpoint
curl --request PATCH \
--url https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks/{receiverId}/endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/nowbookit",
"isActive": false
}
'import requests
url = "https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks/{receiverId}/endpoints"
payload = {
"url": "https://example.com/nowbookit",
"isActive": False
}
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: 'https://example.com/nowbookit', isActive: false})
};
fetch('https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks/{receiverId}/endpoints', 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://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks/{receiverId}/endpoints",
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' => 'https://example.com/nowbookit',
'isActive' => false
]),
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://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks/{receiverId}/endpoints"
payload := strings.NewReader("{\n \"url\": \"https://example.com/nowbookit\",\n \"isActive\": false\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://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks/{receiverId}/endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/nowbookit\",\n \"isActive\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks/{receiverId}/endpoints")
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\": \"https://example.com/nowbookit\",\n \"isActive\": false\n}"
response = http.request(request)
puts response.read_body{
"webhook": {
"receiverId": "3f2b8c1e-6d4a-4f1b-9a7e-2c5d8e9f0a1b",
"orgId": "org_01HXYZEXAMPLE",
"scope": "venues",
"name": "Your integration",
"outputFormat": "standard",
"createdByIntegrationId": "your-integration-id",
"venues": [
{
"venueId": "6319",
"secretLast4": "Q2xY"
}
],
"endpoints": [
{
"url": "https://example.com/nowbookit",
"eventTypes": [
"booking.created",
"booking.updated",
"booking.cancelled"
],
"isActive": true
}
]
}
}{
"code": "ValidationError",
"message": "Request body failed validation",
"requestId": "8f14e45f-ceea-4c6f-8f89-example",
"errors": {
"events": [
"Too small: expected array to have >=1 items"
]
}
}{
"code": "UnauthorisedError",
"message": "Invalid API key",
"requestId": "8f14e45f-ceea-4c6f-8f89-example"
}{
"code": "AppError",
"message": "Only an API key for this venue can manage its webhooks.",
"requestId": "8f14e45f-ceea-4c6f-8f89-example"
}{
"code": "AppError",
"message": "This webhook doesn't send to that URL.",
"requestId": "8f14e45f-ceea-4c6f-8f89-example"
}Name the endpoint by its
url in the body. URLs are matched after normalising, so https://Example.com finds https://example.com/.Authorizations
Your API key, with the webhooks:manage permission. See Authorization.
Path Parameters
Body
application/json
Send events, isActive or both.