Webhooks
Create Webhook
Register a new webhook subscription
POST
/
webhooks
cURL
curl --request POST \
--url https://api.beachdepository.com/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"name": "Inventory notifications",
"url": "https://example.com/webhooks/beach",
"events": [
"inventory.vaulted"
]
}'
const response = await fetch("https://api.beachdepository.com/v1/webhooks", {
method: "POST",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Inventory notifications",
url: "https://example.com/webhooks/beach",
events: ["inventory.vaulted"],
}),
})
const data = await response.json()
import requests
response = requests.post(
"https://api.beachdepository.com/v1/webhooks",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"name": "Inventory notifications",
"url": "https://example.com/webhooks/beach",
"events": [
"inventory.vaulted",
],
},
)
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "https://api.beachdepository.com/v1/webhooks"
payload := strings.NewReader(`{
"name": "Inventory notifications",
"url": "https://example.com/webhooks/beach",
"events": [
"inventory.vaulted"
]
}`)
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
{
"data": {
"id": "ep_abc123",
"signingSecret": "whsec_d4d6eb900e291d584a235aeebff1aabe5297a9eef4b823a5d6dc5532dc67b0a8"
}
}
Creates a new webhook subscription for the organization. The signing secret is returned only once in the response — store it securely for signature verification.
Returns the webhook endpoint ID and signing secret. The signing secret is only shown once.
Authorizations
string
required
Send
Bearer <token> in this header. The key needs webhooks:manage.Body
string
required
string
required
Must use
https:// and a public hostname. Bare IPs, private or loopback addresses, embedded
credentials, names such as .local or .internal, and http:// are rejected.string[]
required
Event types to subscribe to. Must include at least one. See Event
types for all available events.
cURL
curl --request POST \
--url https://api.beachdepository.com/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"name": "Inventory notifications",
"url": "https://example.com/webhooks/beach",
"events": [
"inventory.vaulted"
]
}'
const response = await fetch("https://api.beachdepository.com/v1/webhooks", {
method: "POST",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Inventory notifications",
url: "https://example.com/webhooks/beach",
events: ["inventory.vaulted"],
}),
})
const data = await response.json()
import requests
response = requests.post(
"https://api.beachdepository.com/v1/webhooks",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"name": "Inventory notifications",
"url": "https://example.com/webhooks/beach",
"events": [
"inventory.vaulted",
],
},
)
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "https://api.beachdepository.com/v1/webhooks"
payload := strings.NewReader(`{
"name": "Inventory notifications",
"url": "https://example.com/webhooks/beach",
"events": [
"inventory.vaulted"
]
}`)
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
{
"data": {
"id": "ep_abc123",
"signingSecret": "whsec_d4d6eb900e291d584a235aeebff1aabe5297a9eef4b823a5d6dc5532dc67b0a8"
}
}
This endpoint supports the
Idempotency-Key header.⌘I
cURL
curl --request POST \
--url https://api.beachdepository.com/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"name": "Inventory notifications",
"url": "https://example.com/webhooks/beach",
"events": [
"inventory.vaulted"
]
}'
const response = await fetch("https://api.beachdepository.com/v1/webhooks", {
method: "POST",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Inventory notifications",
url: "https://example.com/webhooks/beach",
events: ["inventory.vaulted"],
}),
})
const data = await response.json()
import requests
response = requests.post(
"https://api.beachdepository.com/v1/webhooks",
headers={
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
},
json={
"name": "Inventory notifications",
"url": "https://example.com/webhooks/beach",
"events": [
"inventory.vaulted",
],
},
)
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
url := "https://api.beachdepository.com/v1/webhooks"
payload := strings.NewReader(`{
"name": "Inventory notifications",
"url": "https://example.com/webhooks/beach",
"events": [
"inventory.vaulted"
]
}`)
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
{
"data": {
"id": "ep_abc123",
"signingSecret": "whsec_d4d6eb900e291d584a235aeebff1aabe5297a9eef4b823a5d6dc5532dc67b0a8"
}
}