#Webhooks
GET /webhooks
List the organization's webhook endpoints, newest first by default.
Requires the webhooks:read permission.
Query Parameters
limitnumberThe number of records to return.
cursorstringA pagination cursor. Fetch the next page by passing the nextCursor value from the previous response.
sorturl | -url | createdAt | -createdAtThe sort order. Prefix a field with - to sort descending. Defaults to -createdAt.
filterstringA JSON-encoded filter document, for example {"createdAt":{"$gte":"2025-01-01T00:00:00Z"}}. Filterable fields: id, url, isActive, createdAt. See Filtering for the syntax.
curl \
"https://api.cascade.dev/webhooks" \
-H "Authorization: Bearer sk_YOUR_SECRET_KEY"import { client } from "@cascade-commerce/api/admin/client"
import { getWebhooks } from "@cascade-commerce/api/admin"
client.setConfig({
baseUrl: "https://api.cascade.dev",
headers: { Authorization: "Bearer sk_YOUR_SECRET_KEY" },
})
const { data, error } = await getWebhooks()require "net/http"
uri = URI("https://api.cascade.dev/webhooks")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer sk_YOUR_SECRET_KEY"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.bodyimport json
from urllib.request import Request, urlopen
req = Request(
"https://api.cascade.dev/webhooks",
headers={"Authorization": "Bearer sk_YOUR_SECRET_KEY"},
)
with urlopen(req) as res:
print(json.load(res)){
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"url": "https://example.com",
"isActive": true,
"events": ["..."],
"hasHmacSecret": true,
"createdAt": "2025-01-15T09:30:00Z",
"updatedAt": "2025-01-15T09:30:00Z"
}
],
"nextCursor": "string"
}{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique identifier for the webhook."
},
"url": {
"type": "string",
"format": "uri",
"description": "The URL deliveries are POSTed to."
},
"isActive": {
"type": "boolean",
"description": "Whether the webhook receives deliveries."
},
"events": {
"type": "array",
"items": {
"type": "string",
"enum": [
"customer.updated",
"customer.deleted",
"customerTag.created",
"customerTag.updated",
"customerTag.deleted",
"order.updated",
"order.deleted",
"orderTag.created",
"orderTag.updated",
"orderTag.deleted",
"product.updated",
"product.deleted",
"productVariant.updated",
"productTag.created",
"productTag.updated",
"productTag.deleted",
"review.created",
"review.updated",
"review.deleted",
"productQuestion.created",
"productQuestion.updated",
"productQuestion.deleted",
"productQuestionAnswer.created",
"productQuestionAnswer.updated",
"productQuestionAnswer.deleted",
"site.created",
"site.updated",
"site.deleted",
"emailTemplate.created",
"emailTemplate.updated",
"emailTemplate.deleted",
"surveyFlow.created",
"surveyFlow.updated",
"surveyFlow.deleted",
"survey.deleted",
"loyaltyProgram.created",
"loyaltyProgram.updated",
"loyaltyProgram.deleted",
"loyaltyRule.created",
"loyaltyRule.updated",
"loyaltyRule.deleted",
"referral.updated",
"loyaltyTier.created",
"loyaltyTier.updated",
"loyaltyTier.deleted",
"loyaltyMembership.created",
"loyaltyMembership.tierChanged",
"loyaltyMembership.deleted",
"loyaltyTransaction.created",
"loyaltyReward.issued",
"loyaltyReward.redeemed",
"loyaltyReward.revoked",
"loyaltyReward.expired",
"loyaltyReward.expiringSoon",
"loyaltyPoints.expiringSoon",
"stampCard.created",
"stampCard.updated",
"stampCard.completed",
"quickFilter.created",
"quickFilter.updated",
"quickFilter.deleted",
"wishlist.created",
"wishlist.updated",
"wishlist.deleted",
"webhook.created",
"webhook.updated",
"webhook.deleted"
],
"description": "A webhook event name, in `resource.action` form."
},
"description": "The events this webhook subscribes to."
},
"hasHmacSecret": {
"type": "boolean",
"description": "Whether a signing secret is set. The secret itself is never returned. When set, deliveries carry an HMAC signature you can verify."
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
"description": "When the webhook was created."
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
"description": "When the webhook was last changed."
}
},
"required": ["id", "url", "isActive", "events", "hasHmacSecret", "createdAt", "updatedAt"],
"additionalProperties": false
},
"description": "The page of records, in the requested sort order."
},
"nextCursor": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Pass this back as `cursor` to fetch the next page. Null once the last page has been returned."
}
},
"required": ["data", "nextCursor"],
"additionalProperties": false
}POST /webhooks
Register a webhook endpoint. It starts receiving deliveries for the events you subscribe to as soon as it is active. Triggers the webhook.created webhook.
Requires the webhooks:write permission.
Body Parameters
dataobjectrequiredThe webhook to create.
curl \
-X POST \
"https://api.cascade.dev/webhooks" \
-H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": {
"url": "https://example.com",
"events": [
"customer.updated"
],
"isActive": true,
"hmacSecret": "string"
}
}'import { client } from "@cascade-commerce/api/admin/client"
import { postWebhooks } from "@cascade-commerce/api/admin"
client.setConfig({
baseUrl: "https://api.cascade.dev",
headers: { Authorization: "Bearer sk_YOUR_SECRET_KEY" },
})
const { data, error } = await postWebhooks({
body: {
data: {
url: "https://example.com",
events: ["customer.updated"],
isActive: true,
hmacSecret: "string",
},
},
})require "net/http"
uri = URI("https://api.cascade.dev/webhooks")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer sk_YOUR_SECRET_KEY"
req["Content-Type"] = "application/json"
req.body = <<~JSON
{
"data": {
"url": "https://example.com",
"events": [
"customer.updated"
],
"isActive": true,
"hmacSecret": "string"
}
}
JSON
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.bodyimport json
from urllib.request import Request, urlopen
body = """{
"data": {
"url": "https://example.com",
"events": [
"customer.updated"
],
"isActive": true,
"hmacSecret": "string"
}
}"""
req = Request(
"https://api.cascade.dev/webhooks",
data=body.encode(),
headers={
"Authorization": "Bearer sk_YOUR_SECRET_KEY",
"Content-Type": "application/json",
},
)
with urlopen(req) as res:
print(json.load(res)){
"id": "550e8400-e29b-41d4-a716-446655440000",
"url": "https://example.com",
"isActive": true,
"events": ["customer.updated"],
"hasHmacSecret": true,
"createdAt": "2025-01-15T09:30:00Z",
"updatedAt": "2025-01-15T09:30:00Z"
}{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique identifier for the webhook."
},
"url": {
"type": "string",
"format": "uri",
"description": "The URL deliveries are POSTed to."
},
"isActive": {
"type": "boolean",
"description": "Whether the webhook receives deliveries."
},
"events": {
"type": "array",
"items": {
"type": "string",
"enum": [
"customer.updated",
"customer.deleted",
"customerTag.created",
"customerTag.updated",
"customerTag.deleted",
"order.updated",
"order.deleted",
"orderTag.created",
"orderTag.updated",
"orderTag.deleted",
"product.updated",
"product.deleted",
"productVariant.updated",
"productTag.created",
"productTag.updated",
"productTag.deleted",
"review.created",
"review.updated",
"review.deleted",
"productQuestion.created",
"productQuestion.updated",
"productQuestion.deleted",
"productQuestionAnswer.created",
"productQuestionAnswer.updated",
"productQuestionAnswer.deleted",
"site.created",
"site.updated",
"site.deleted",
"emailTemplate.created",
"emailTemplate.updated",
"emailTemplate.deleted",
"surveyFlow.created",
"surveyFlow.updated",
"surveyFlow.deleted",
"survey.deleted",
"loyaltyProgram.created",
"loyaltyProgram.updated",
"loyaltyProgram.deleted",
"loyaltyRule.created",
"loyaltyRule.updated",
"loyaltyRule.deleted",
"referral.updated",
"loyaltyTier.created",
"loyaltyTier.updated",
"loyaltyTier.deleted",
"loyaltyMembership.created",
"loyaltyMembership.tierChanged",
"loyaltyMembership.deleted",
"loyaltyTransaction.created",
"loyaltyReward.issued",
"loyaltyReward.redeemed",
"loyaltyReward.revoked",
"loyaltyReward.expired",
"loyaltyReward.expiringSoon",
"loyaltyPoints.expiringSoon",
"stampCard.created",
"stampCard.updated",
"stampCard.completed",
"quickFilter.created",
"quickFilter.updated",
"quickFilter.deleted",
"wishlist.created",
"wishlist.updated",
"wishlist.deleted",
"webhook.created",
"webhook.updated",
"webhook.deleted"
],
"description": "A webhook event name, in `resource.action` form."
},
"description": "The events this webhook subscribes to."
},
"hasHmacSecret": {
"type": "boolean",
"description": "Whether a signing secret is set. The secret itself is never returned. When set, deliveries carry an HMAC signature you can verify."
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
"description": "When the webhook was created."
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
"description": "When the webhook was last changed."
}
},
"required": ["id", "url", "isActive", "events", "hasHmacSecret", "createdAt", "updatedAt"],
"additionalProperties": false,
"description": "The new webhook."
}GET /webhooks/{id}
Get a single webhook by ID.
Requires the webhooks:read permission.
Path Parameters
idstring (uuid)requiredThe ID of the webhook.
curl \
"https://api.cascade.dev/webhooks/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer sk_YOUR_SECRET_KEY"import { client } from "@cascade-commerce/api/admin/client"
import { getWebhooksById } from "@cascade-commerce/api/admin"
client.setConfig({
baseUrl: "https://api.cascade.dev",
headers: { Authorization: "Bearer sk_YOUR_SECRET_KEY" },
})
const { data, error } = await getWebhooksById({
path: { id: "550e8400-e29b-41d4-a716-446655440000" },
})require "net/http"
uri = URI("https://api.cascade.dev/webhooks/550e8400-e29b-41d4-a716-446655440000")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer sk_YOUR_SECRET_KEY"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.bodyimport json
from urllib.request import Request, urlopen
req = Request(
"https://api.cascade.dev/webhooks/550e8400-e29b-41d4-a716-446655440000",
headers={"Authorization": "Bearer sk_YOUR_SECRET_KEY"},
)
with urlopen(req) as res:
print(json.load(res)){
"id": "550e8400-e29b-41d4-a716-446655440000",
"url": "https://example.com",
"isActive": true,
"events": ["customer.updated"],
"hasHmacSecret": true,
"createdAt": "2025-01-15T09:30:00Z",
"updatedAt": "2025-01-15T09:30:00Z"
}{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique identifier for the webhook."
},
"url": {
"type": "string",
"format": "uri",
"description": "The URL deliveries are POSTed to."
},
"isActive": {
"type": "boolean",
"description": "Whether the webhook receives deliveries."
},
"events": {
"type": "array",
"items": {
"type": "string",
"enum": [
"customer.updated",
"customer.deleted",
"customerTag.created",
"customerTag.updated",
"customerTag.deleted",
"order.updated",
"order.deleted",
"orderTag.created",
"orderTag.updated",
"orderTag.deleted",
"product.updated",
"product.deleted",
"productVariant.updated",
"productTag.created",
"productTag.updated",
"productTag.deleted",
"review.created",
"review.updated",
"review.deleted",
"productQuestion.created",
"productQuestion.updated",
"productQuestion.deleted",
"productQuestionAnswer.created",
"productQuestionAnswer.updated",
"productQuestionAnswer.deleted",
"site.created",
"site.updated",
"site.deleted",
"emailTemplate.created",
"emailTemplate.updated",
"emailTemplate.deleted",
"surveyFlow.created",
"surveyFlow.updated",
"surveyFlow.deleted",
"survey.deleted",
"loyaltyProgram.created",
"loyaltyProgram.updated",
"loyaltyProgram.deleted",
"loyaltyRule.created",
"loyaltyRule.updated",
"loyaltyRule.deleted",
"referral.updated",
"loyaltyTier.created",
"loyaltyTier.updated",
"loyaltyTier.deleted",
"loyaltyMembership.created",
"loyaltyMembership.tierChanged",
"loyaltyMembership.deleted",
"loyaltyTransaction.created",
"loyaltyReward.issued",
"loyaltyReward.redeemed",
"loyaltyReward.revoked",
"loyaltyReward.expired",
"loyaltyReward.expiringSoon",
"loyaltyPoints.expiringSoon",
"stampCard.created",
"stampCard.updated",
"stampCard.completed",
"quickFilter.created",
"quickFilter.updated",
"quickFilter.deleted",
"wishlist.created",
"wishlist.updated",
"wishlist.deleted",
"webhook.created",
"webhook.updated",
"webhook.deleted"
],
"description": "A webhook event name, in `resource.action` form."
},
"description": "The events this webhook subscribes to."
},
"hasHmacSecret": {
"type": "boolean",
"description": "Whether a signing secret is set. The secret itself is never returned. When set, deliveries carry an HMAC signature you can verify."
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
"description": "When the webhook was created."
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
"description": "When the webhook was last changed."
}
},
"required": ["id", "url", "isActive", "events", "hasHmacSecret", "createdAt", "updatedAt"],
"additionalProperties": false,
"description": "The requested webhook."
}PUT /webhooks/{id}
Update a webhook's URL, subscriptions, signing secret or active flag. Triggers the webhook.updated webhook.
Requires the webhooks:write permission.
Path Parameters
idstring (uuid)requiredThe ID of the webhook to update.
Body Parameters
dataobjectrequiredThe fields to update.
curl \
-X PUT \
"https://api.cascade.dev/webhooks/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": {
"url": "https://example.com",
"events": [
"customer.updated"
],
"isActive": true,
"hmacSecret": "string"
}
}'import { client } from "@cascade-commerce/api/admin/client"
import { putWebhooksById } from "@cascade-commerce/api/admin"
client.setConfig({
baseUrl: "https://api.cascade.dev",
headers: { Authorization: "Bearer sk_YOUR_SECRET_KEY" },
})
const { data, error } = await putWebhooksById({
path: { id: "550e8400-e29b-41d4-a716-446655440000" },
body: {
data: {
url: "https://example.com",
events: ["customer.updated"],
isActive: true,
hmacSecret: "string",
},
},
})require "net/http"
uri = URI("https://api.cascade.dev/webhooks/550e8400-e29b-41d4-a716-446655440000")
req = Net::HTTP::Put.new(uri)
req["Authorization"] = "Bearer sk_YOUR_SECRET_KEY"
req["Content-Type"] = "application/json"
req.body = <<~JSON
{
"data": {
"url": "https://example.com",
"events": [
"customer.updated"
],
"isActive": true,
"hmacSecret": "string"
}
}
JSON
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.bodyimport json
from urllib.request import Request, urlopen
body = """{
"data": {
"url": "https://example.com",
"events": [
"customer.updated"
],
"isActive": true,
"hmacSecret": "string"
}
}"""
req = Request(
"https://api.cascade.dev/webhooks/550e8400-e29b-41d4-a716-446655440000",
data=body.encode(),
method="PUT",
headers={
"Authorization": "Bearer sk_YOUR_SECRET_KEY",
"Content-Type": "application/json",
},
)
with urlopen(req) as res:
print(json.load(res)){
"id": "550e8400-e29b-41d4-a716-446655440000",
"url": "https://example.com",
"isActive": true,
"events": ["customer.updated"],
"hasHmacSecret": true,
"createdAt": "2025-01-15T09:30:00Z",
"updatedAt": "2025-01-15T09:30:00Z"
}{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique identifier for the webhook."
},
"url": {
"type": "string",
"format": "uri",
"description": "The URL deliveries are POSTed to."
},
"isActive": {
"type": "boolean",
"description": "Whether the webhook receives deliveries."
},
"events": {
"type": "array",
"items": {
"type": "string",
"enum": [
"customer.updated",
"customer.deleted",
"customerTag.created",
"customerTag.updated",
"customerTag.deleted",
"order.updated",
"order.deleted",
"orderTag.created",
"orderTag.updated",
"orderTag.deleted",
"product.updated",
"product.deleted",
"productVariant.updated",
"productTag.created",
"productTag.updated",
"productTag.deleted",
"review.created",
"review.updated",
"review.deleted",
"productQuestion.created",
"productQuestion.updated",
"productQuestion.deleted",
"productQuestionAnswer.created",
"productQuestionAnswer.updated",
"productQuestionAnswer.deleted",
"site.created",
"site.updated",
"site.deleted",
"emailTemplate.created",
"emailTemplate.updated",
"emailTemplate.deleted",
"surveyFlow.created",
"surveyFlow.updated",
"surveyFlow.deleted",
"survey.deleted",
"loyaltyProgram.created",
"loyaltyProgram.updated",
"loyaltyProgram.deleted",
"loyaltyRule.created",
"loyaltyRule.updated",
"loyaltyRule.deleted",
"referral.updated",
"loyaltyTier.created",
"loyaltyTier.updated",
"loyaltyTier.deleted",
"loyaltyMembership.created",
"loyaltyMembership.tierChanged",
"loyaltyMembership.deleted",
"loyaltyTransaction.created",
"loyaltyReward.issued",
"loyaltyReward.redeemed",
"loyaltyReward.revoked",
"loyaltyReward.expired",
"loyaltyReward.expiringSoon",
"loyaltyPoints.expiringSoon",
"stampCard.created",
"stampCard.updated",
"stampCard.completed",
"quickFilter.created",
"quickFilter.updated",
"quickFilter.deleted",
"wishlist.created",
"wishlist.updated",
"wishlist.deleted",
"webhook.created",
"webhook.updated",
"webhook.deleted"
],
"description": "A webhook event name, in `resource.action` form."
},
"description": "The events this webhook subscribes to."
},
"hasHmacSecret": {
"type": "boolean",
"description": "Whether a signing secret is set. The secret itself is never returned. When set, deliveries carry an HMAC signature you can verify."
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
"description": "When the webhook was created."
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
"description": "When the webhook was last changed."
}
},
"required": ["id", "url", "isActive", "events", "hasHmacSecret", "createdAt", "updatedAt"],
"additionalProperties": false,
"description": "The updated webhook."
}DELETE /webhooks/{id}
Delete a webhook endpoint, stopping all deliveries to it. To pause it instead, set isActive to false. Triggers the webhook.deleted webhook.
Requires the webhooks:write permission.
Path Parameters
idstring (uuid)requiredThe ID of the webhook to delete.
curl \
-X DELETE \
"https://api.cascade.dev/webhooks/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer sk_YOUR_SECRET_KEY"import { client } from "@cascade-commerce/api/admin/client"
import { deleteWebhooksById } from "@cascade-commerce/api/admin"
client.setConfig({
baseUrl: "https://api.cascade.dev",
headers: { Authorization: "Bearer sk_YOUR_SECRET_KEY" },
})
const { data, error } = await deleteWebhooksById({
path: { id: "550e8400-e29b-41d4-a716-446655440000" },
})require "net/http"
uri = URI("https://api.cascade.dev/webhooks/550e8400-e29b-41d4-a716-446655440000")
req = Net::HTTP::Delete.new(uri)
req["Authorization"] = "Bearer sk_YOUR_SECRET_KEY"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.bodyimport json
from urllib.request import Request, urlopen
req = Request(
"https://api.cascade.dev/webhooks/550e8400-e29b-41d4-a716-446655440000",
method="DELETE",
headers={"Authorization": "Bearer sk_YOUR_SECRET_KEY"},
)
with urlopen(req) as res:
print(json.load(res)){
"id": "550e8400-e29b-41d4-a716-446655440000",
"url": "https://example.com",
"isActive": true,
"events": ["customer.updated"],
"hasHmacSecret": true,
"createdAt": "2025-01-15T09:30:00Z",
"updatedAt": "2025-01-15T09:30:00Z"
}{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique identifier for the webhook."
},
"url": {
"type": "string",
"format": "uri",
"description": "The URL deliveries are POSTed to."
},
"isActive": {
"type": "boolean",
"description": "Whether the webhook receives deliveries."
},
"events": {
"type": "array",
"items": {
"type": "string",
"enum": [
"customer.updated",
"customer.deleted",
"customerTag.created",
"customerTag.updated",
"customerTag.deleted",
"order.updated",
"order.deleted",
"orderTag.created",
"orderTag.updated",
"orderTag.deleted",
"product.updated",
"product.deleted",
"productVariant.updated",
"productTag.created",
"productTag.updated",
"productTag.deleted",
"review.created",
"review.updated",
"review.deleted",
"productQuestion.created",
"productQuestion.updated",
"productQuestion.deleted",
"productQuestionAnswer.created",
"productQuestionAnswer.updated",
"productQuestionAnswer.deleted",
"site.created",
"site.updated",
"site.deleted",
"emailTemplate.created",
"emailTemplate.updated",
"emailTemplate.deleted",
"surveyFlow.created",
"surveyFlow.updated",
"surveyFlow.deleted",
"survey.deleted",
"loyaltyProgram.created",
"loyaltyProgram.updated",
"loyaltyProgram.deleted",
"loyaltyRule.created",
"loyaltyRule.updated",
"loyaltyRule.deleted",
"referral.updated",
"loyaltyTier.created",
"loyaltyTier.updated",
"loyaltyTier.deleted",
"loyaltyMembership.created",
"loyaltyMembership.tierChanged",
"loyaltyMembership.deleted",
"loyaltyTransaction.created",
"loyaltyReward.issued",
"loyaltyReward.redeemed",
"loyaltyReward.revoked",
"loyaltyReward.expired",
"loyaltyReward.expiringSoon",
"loyaltyPoints.expiringSoon",
"stampCard.created",
"stampCard.updated",
"stampCard.completed",
"quickFilter.created",
"quickFilter.updated",
"quickFilter.deleted",
"wishlist.created",
"wishlist.updated",
"wishlist.deleted",
"webhook.created",
"webhook.updated",
"webhook.deleted"
],
"description": "A webhook event name, in `resource.action` form."
},
"description": "The events this webhook subscribes to."
},
"hasHmacSecret": {
"type": "boolean",
"description": "Whether a signing secret is set. The secret itself is never returned. When set, deliveries carry an HMAC signature you can verify."
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
"description": "When the webhook was created."
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
"description": "When the webhook was last changed."
}
},
"required": ["id", "url", "isActive", "events", "hasHmacSecret", "createdAt", "updatedAt"],
"additionalProperties": false,
"description": "The deleted webhook."
}GET /webhooks/{id}/events
List a webhook's recent deliveries, newest first, with their payloads and any errors. Use this to debug an endpoint that is not receiving what you expect.
Requires the webhooks:read permission.
Path Parameters
idstring (uuid)requiredThe ID of the webhook.
Query Parameters
limitnumberThe number of deliveries to return.
curl \
"https://api.cascade.dev/webhooks/550e8400-e29b-41d4-a716-446655440000/events" \
-H "Authorization: Bearer sk_YOUR_SECRET_KEY"import { client } from "@cascade-commerce/api/admin/client"
import { getWebhooksByIdEvents } from "@cascade-commerce/api/admin"
client.setConfig({
baseUrl: "https://api.cascade.dev",
headers: { Authorization: "Bearer sk_YOUR_SECRET_KEY" },
})
const { data, error } = await getWebhooksByIdEvents({
path: { id: "550e8400-e29b-41d4-a716-446655440000" },
})require "net/http"
uri = URI("https://api.cascade.dev/webhooks/550e8400-e29b-41d4-a716-446655440000/events")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer sk_YOUR_SECRET_KEY"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.bodyimport json
from urllib.request import Request, urlopen
req = Request(
"https://api.cascade.dev/webhooks/550e8400-e29b-41d4-a716-446655440000/events",
headers={"Authorization": "Bearer sk_YOUR_SECRET_KEY"},
)
with urlopen(req) as res:
print(json.load(res)){
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"webhookId": "550e8400-e29b-41d4-a716-446655440000",
"eventName": "customer.updated",
"idempotencyKey": "string",
"url": "https://example.com",
"payload": "...",
"status": "string",
"error": "string",
"createdAt": "2025-01-15T09:30:00Z",
"updatedAt": "2025-01-15T09:30:00Z"
}
],
"nextCursor": "string"
}{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "Unique identifier for the delivery."
},
"webhookId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
"description": "The webhook the delivery belongs to."
},
"eventName": {
"type": "string",
"enum": [
"customer.updated",
"customer.deleted",
"customerTag.created",
"customerTag.updated",
"customerTag.deleted",
"order.updated",
"order.deleted",
"orderTag.created",
"orderTag.updated",
"orderTag.deleted",
"product.updated",
"product.deleted",
"productVariant.updated",
"productTag.created",
"productTag.updated",
"productTag.deleted",
"review.created",
"review.updated",
"review.deleted",
"productQuestion.created",
"productQuestion.updated",
"productQuestion.deleted",
"productQuestionAnswer.created",
"productQuestionAnswer.updated",
"productQuestionAnswer.deleted",
"site.created",
"site.updated",
"site.deleted",
"emailTemplate.created",
"emailTemplate.updated",
"emailTemplate.deleted",
"surveyFlow.created",
"surveyFlow.updated",
"surveyFlow.deleted",
"survey.deleted",
"loyaltyProgram.created",
"loyaltyProgram.updated",
"loyaltyProgram.deleted",
"loyaltyRule.created",
"loyaltyRule.updated",
"loyaltyRule.deleted",
"referral.updated",
"loyaltyTier.created",
"loyaltyTier.updated",
"loyaltyTier.deleted",
"loyaltyMembership.created",
"loyaltyMembership.tierChanged",
"loyaltyMembership.deleted",
"loyaltyTransaction.created",
"loyaltyReward.issued",
"loyaltyReward.redeemed",
"loyaltyReward.revoked",
"loyaltyReward.expired",
"loyaltyReward.expiringSoon",
"loyaltyPoints.expiringSoon",
"stampCard.created",
"stampCard.updated",
"stampCard.completed",
"quickFilter.created",
"quickFilter.updated",
"quickFilter.deleted",
"wishlist.created",
"wishlist.updated",
"wishlist.deleted",
"webhook.created",
"webhook.updated",
"webhook.deleted"
],
"description": "A webhook event name, in `resource.action` form."
},
"idempotencyKey": {
"type": "string",
"description": "Stable key for this delivery. Use it to ignore duplicates on your end."
},
"url": {
"type": "string",
"format": "uri",
"description": "The URL the delivery was sent to."
},
"payload": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {},
"description": "The JSON body that was sent."
},
"status": {
"type": "string",
"description": "How the delivery went: `succeeded` if your endpoint accepted it, `failed` if not."
},
"error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Why the delivery failed, if it did."
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
"description": "When the delivery was queued."
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
"description": "When the delivery was last attempted."
}
},
"required": [
"id",
"webhookId",
"eventName",
"idempotencyKey",
"url",
"payload",
"status",
"error",
"createdAt",
"updatedAt"
],
"additionalProperties": false
},
"description": "The page of records, in the requested sort order."
},
"nextCursor": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Pass this back as `cursor` to fetch the next page. Null once the last page has been returned."
}
},
"required": ["data", "nextCursor"],
"additionalProperties": false
}