Create a webhook
curl --request POST \
--url https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/nowbookit",
"events": [
"booking.created",
"booking.updated",
"booking.cancelled"
]
}
'import requests
url = "https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks"
payload = {
"url": "https://example.com/nowbookit",
"events": ["booking.created", "booking.updated", "booking.cancelled"]
}
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({
url: 'https://example.com/nowbookit',
events: ['booking.created', 'booking.updated', 'booking.cancelled']
})
};
fetch('https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/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://platform.uat.nowbookit.com/api/comms/venue/{venueId}/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([
'url' => 'https://example.com/nowbookit',
'events' => [
'booking.created',
'booking.updated',
'booking.cancelled'
]
]),
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"
payload := strings.NewReader("{\n \"url\": \"https://example.com/nowbookit\",\n \"events\": [\n \"booking.created\",\n \"booking.updated\",\n \"booking.cancelled\"\n ]\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("https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/nowbookit\",\n \"events\": [\n \"booking.created\",\n \"booking.updated\",\n \"booking.cancelled\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/nowbookit\",\n \"events\": [\n \"booking.created\",\n \"booking.updated\",\n \"booking.cancelled\"\n ]\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
}
]
},
"secret": "whsec_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}{
"code": "AppError",
"message": "That address points inside a private network. Use a public endpoint.",
"requestId": "8f14e45f-ceea-4c6f-8f89-example"
}{
"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": "Webhooks aren't switched on for this organisation.",
"requestId": "8f14e45f-ceea-4c6f-8f89-example"
}Webhooks
Create a Webhook
Create a webhook and get its signing secret.
POST
/
venue
/
{venueId}
/
webhooks
Create a webhook
curl --request POST \
--url https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/nowbookit",
"events": [
"booking.created",
"booking.updated",
"booking.cancelled"
]
}
'import requests
url = "https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks"
payload = {
"url": "https://example.com/nowbookit",
"events": ["booking.created", "booking.updated", "booking.cancelled"]
}
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({
url: 'https://example.com/nowbookit',
events: ['booking.created', 'booking.updated', 'booking.cancelled']
})
};
fetch('https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/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://platform.uat.nowbookit.com/api/comms/venue/{venueId}/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([
'url' => 'https://example.com/nowbookit',
'events' => [
'booking.created',
'booking.updated',
'booking.cancelled'
]
]),
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"
payload := strings.NewReader("{\n \"url\": \"https://example.com/nowbookit\",\n \"events\": [\n \"booking.created\",\n \"booking.updated\",\n \"booking.cancelled\"\n ]\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("https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/nowbookit\",\n \"events\": [\n \"booking.created\",\n \"booking.updated\",\n \"booking.cancelled\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform.uat.nowbookit.com/api/comms/venue/{venueId}/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/nowbookit\",\n \"events\": [\n \"booking.created\",\n \"booking.updated\",\n \"booking.cancelled\"\n ]\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
}
]
},
"secret": "whsec_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}{
"code": "AppError",
"message": "That address points inside a private network. Use a public endpoint.",
"requestId": "8f14e45f-ceea-4c6f-8f89-example"
}{
"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": "Webhooks aren't switched on for this organisation.",
"requestId": "8f14e45f-ceea-4c6f-8f89-example"
}The
secret is returned only in this response. Store it now. If you lose it, rotate it.Authorizations
Your API key, with the webhooks:manage permission. See Authorization.
Body
application/json
The events to send. Booking events need reservations:read on your key, gift card events giftcards:read.
Minimum array length:
1Available options:
booking.created, booking.updated, booking.seated, booking.finished, booking.cancelled, giftcard.created, giftcard.updated, giftcard.cancelled, giftcard.redeemed