cURL
curl -X POST "https://api.myworklayer.com/v1/subscriptions" \
-H "Authorization: Bearer $WORKLAYER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Support backend",
"url": "https://hooks.example.com/worklayer",
"events": [
"room.response",
"reviews.questions.created",
"reviews.approvals.created"
]
}'const response = await fetch('https://api.myworklayer.com/v1/subscriptions', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.WORKLAYER_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "Support backend",
"url": "https://hooks.example.com/worklayer",
"events": [
"room.response",
"reviews.questions.created",
"reviews.approvals.created"
]
}),
});
const data = await response.json();
console.log(data);{
"id": "0f8e2b7c-5a1d-4c3e-9b6f-2d7a8c1e4f90",
"name": "Support backend",
"url": "https://hooks.example.com/worklayer",
"enabled": true,
"createdAt": "2026-11-20T15:02:44.120Z",
"updatedAt": "2026-11-20T15:02:44.120Z",
"events": [
"room.response",
"reviews.questions.created",
"reviews.approvals.created"
],
"secret": "whsec_ZXhhbXBsZS1zaWduaW5nLXNlY3JldC1mb3ItZG9jczE="
}{
"statusCode": 400,
"message": "Invalid webhook request",
"error": "Bad Request"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 429,
"message": "ThrottlerException: Too Many Requests"
}Subscriptions
Create a subscription
Creates a webhook Subscription for the selected event topics across all Rooms of your factory. Save the returned signing secret immediately—it is shown only once. See Subscriptions.
POST
/
v1
/
subscriptions
cURL
curl -X POST "https://api.myworklayer.com/v1/subscriptions" \
-H "Authorization: Bearer $WORKLAYER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Support backend",
"url": "https://hooks.example.com/worklayer",
"events": [
"room.response",
"reviews.questions.created",
"reviews.approvals.created"
]
}'const response = await fetch('https://api.myworklayer.com/v1/subscriptions', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.WORKLAYER_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "Support backend",
"url": "https://hooks.example.com/worklayer",
"events": [
"room.response",
"reviews.questions.created",
"reviews.approvals.created"
]
}),
});
const data = await response.json();
console.log(data);{
"id": "0f8e2b7c-5a1d-4c3e-9b6f-2d7a8c1e4f90",
"name": "Support backend",
"url": "https://hooks.example.com/worklayer",
"enabled": true,
"createdAt": "2026-11-20T15:02:44.120Z",
"updatedAt": "2026-11-20T15:02:44.120Z",
"events": [
"room.response",
"reviews.questions.created",
"reviews.approvals.created"
],
"secret": "whsec_ZXhhbXBsZS1zaWduaW5nLXNlY3JldC1mb3ItZG9jczE="
}{
"statusCode": 400,
"message": "Invalid webhook request",
"error": "Bad Request"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 429,
"message": "ThrottlerException: Too Many Requests"
}Authorizations
Your factory's Worklayer API key (wrk-...). See Get an API key and Authentication. Requests sent from the playground execute live against your factory.
Body
application/json
Response
The new subscription, with its signing secret.