curl --request POST \
--url https://api-sandbox.unifystays.com/webhooks/endpoints \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Production booking events",
"url": "https://example.com/webhooks/unifystays",
"event_types": [
"booking.confirmed",
"booking.cancelled"
]
}
'import requests
url = "https://api-sandbox.unifystays.com/webhooks/endpoints"
payload = {
"name": "Production booking events",
"url": "https://example.com/webhooks/unifystays",
"event_types": ["booking.confirmed", "booking.cancelled"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Production booking events',
url: 'https://example.com/webhooks/unifystays',
event_types: ['booking.confirmed', 'booking.cancelled']
})
};
fetch('https://api-sandbox.unifystays.com/webhooks/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://api-sandbox.unifystays.com/webhooks/endpoints",
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([
'name' => 'Production booking events',
'url' => 'https://example.com/webhooks/unifystays',
'event_types' => [
'booking.confirmed',
'booking.cancelled'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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-sandbox.unifystays.com/webhooks/endpoints"
payload := strings.NewReader("{\n \"name\": \"Production booking events\",\n \"url\": \"https://example.com/webhooks/unifystays\",\n \"event_types\": [\n \"booking.confirmed\",\n \"booking.cancelled\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api-sandbox.unifystays.com/webhooks/endpoints")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Production booking events\",\n \"url\": \"https://example.com/webhooks/unifystays\",\n \"event_types\": [\n \"booking.confirmed\",\n \"booking.cancelled\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.unifystays.com/webhooks/endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Production booking events\",\n \"url\": \"https://example.com/webhooks/unifystays\",\n \"event_types\": [\n \"booking.confirmed\",\n \"booking.cancelled\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "8b95a9e0-4af3-4c6d-92df-84b64256d27f",
"name": "Production booking events",
"url": "https://example.com/webhooks/unifystays",
"status": "ACTIVE",
"event_types": [
"booking.confirmed",
"booking.cancelled"
],
"consecutive_failures": 0,
"last_success_at": "2026-08-08T08:30:00.000Z",
"last_failure_at": null,
"disabled_at": null,
"disabled_reason": null,
"created_at": "2026-08-08T08:00:00.000Z",
"updated_at": "2026-08-08T08:30:00.000Z",
"signing_secret": "whsec_************************"
}Create Webhook Endpoint
Register a webhook URL and receive its one-time signing secret.
curl --request POST \
--url https://api-sandbox.unifystays.com/webhooks/endpoints \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Production booking events",
"url": "https://example.com/webhooks/unifystays",
"event_types": [
"booking.confirmed",
"booking.cancelled"
]
}
'import requests
url = "https://api-sandbox.unifystays.com/webhooks/endpoints"
payload = {
"name": "Production booking events",
"url": "https://example.com/webhooks/unifystays",
"event_types": ["booking.confirmed", "booking.cancelled"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Production booking events',
url: 'https://example.com/webhooks/unifystays',
event_types: ['booking.confirmed', 'booking.cancelled']
})
};
fetch('https://api-sandbox.unifystays.com/webhooks/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://api-sandbox.unifystays.com/webhooks/endpoints",
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([
'name' => 'Production booking events',
'url' => 'https://example.com/webhooks/unifystays',
'event_types' => [
'booking.confirmed',
'booking.cancelled'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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-sandbox.unifystays.com/webhooks/endpoints"
payload := strings.NewReader("{\n \"name\": \"Production booking events\",\n \"url\": \"https://example.com/webhooks/unifystays\",\n \"event_types\": [\n \"booking.confirmed\",\n \"booking.cancelled\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api-sandbox.unifystays.com/webhooks/endpoints")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Production booking events\",\n \"url\": \"https://example.com/webhooks/unifystays\",\n \"event_types\": [\n \"booking.confirmed\",\n \"booking.cancelled\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.unifystays.com/webhooks/endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Production booking events\",\n \"url\": \"https://example.com/webhooks/unifystays\",\n \"event_types\": [\n \"booking.confirmed\",\n \"booking.cancelled\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "8b95a9e0-4af3-4c6d-92df-84b64256d27f",
"name": "Production booking events",
"url": "https://example.com/webhooks/unifystays",
"status": "ACTIVE",
"event_types": [
"booking.confirmed",
"booking.cancelled"
],
"consecutive_failures": 0,
"last_success_at": "2026-08-08T08:30:00.000Z",
"last_failure_at": null,
"disabled_at": null,
"disabled_reason": null,
"created_at": "2026-08-08T08:00:00.000Z",
"updated_at": "2026-08-08T08:30:00.000Z",
"signing_secret": "whsec_************************"
}booking.* to receive every booking event.
signing_secret is returned only once. Store it securely before
discarding the response.ACTIVE status.Authorizations
Environment-specific API key created in the Unifystays portal
Headers
Body
Human-readable name shown in webhook logs and the portal.
1 - 120"Production booking events"
Public HTTPS URL that receives webhook POST requests. Private, loopback, link-local, and internal hosts are rejected.
8 - 2048"https://example.com/webhooks/unifystays"
Event types delivered to this endpoint. Use booking.* to subscribe to every booking event.
1 - 20 elementsbooking.created, booking.confirmed, booking.failed, booking.cancellation_requested, booking.cancelled, booking.cancellation_failed, booking.* ["booking.confirmed", "booking.cancelled"]
Response
The signing secret is returned only in this response.
Unique webhook endpoint identifier.
"8b95a9e0-4af3-4c6d-92df-84b64256d27f"
Human-readable endpoint name.
"Production booking events"
URL that receives signed webhook POST requests.
"https://example.com/webhooks/unifystays"
Current endpoint state. Paused and disabled endpoints do not receive new deliveries.
ACTIVE, PAUSED, DISABLED "ACTIVE"
Normalized event subscriptions for this endpoint.
booking.created, booking.confirmed, booking.failed, booking.cancellation_requested, booking.cancelled, booking.cancellation_failed, booking.* ["booking.confirmed", "booking.cancelled"]
Consecutive delivery failures since the last success or reactivation.
0
Time of the most recent successful delivery, if any.
"2026-08-08T08:30:00.000Z"
Time of the most recent failed delivery, if any.
null
Time the endpoint was disabled, if applicable.
null
Reason the endpoint was disabled, if applicable.
null
Endpoint creation time.
"2026-08-08T08:00:00.000Z"
Time the endpoint was last updated.
"2026-08-08T08:30:00.000Z"
HMAC signing secret. Returned only once; store it securely before discarding the response.
"whsec_************************"