Help · Automations
Webhook steps
A webhook step sends a person's details to another system when they reach it — a spreadsheet, your team's chat, a loyalty program or your own software. It sends data, not a message, so the person never sees it.
What a webhook step does
When somebody reaches a live webhook step, it fills in your body with their details and sends it to your address, and the person carries on at once. Set three parts in its panel:
- URL — the web address the other system gave you, starting https://.
- What it sends — the body, written as JSON. Add a detail puts the person's details in.
- Headers, if the other system asks for them — a key, usually, up to ten.
Start from fills in What it sends for a common use; the Webhook recipes page walks through each. Save and add the step puts a new one on the map.
Who can set one up
Only an owner or a manager can add a webhook step, change where and what it sends, see its full URL, or send a test. A marketer sees the step with the URL's path hidden, and its Recent calls, and can enable it or set it back to draft:
Only an owner or manager can see what this webhook sends.
The full URL is treated like a password, and a header's value is never shown again once saved. A new webhook step starts as a draft. Nobody at Carpe Messaging can add one or change where it sends.
What is sent
Exactly the body you write, with each detail filled in: the person's email address, first name, last name, phone number and profile ID, and the details of the event that started the automation. A body for a new order might read:
{
"email": "{{email}}",
"first_name": "{{first_name}}",
"order": "{{event:order_number|\"\"}}"
}Every detail arrives as text — a total as "42.50". A fallback inside the body has a backslash before each quote mark, which Add a detail writes for you. A saved change applies at once, without Apply changes.
Who it runs for
It runs whether or not the person gave you consent, because it sends to your own system rather than to them. It never runs for a profile you deleted, and skips anyone whose request not to have their data sold or shared is on record — a best effort, not a guarantee.
When it is sent
Usually within a minute or two. If the other system is down or busy, it tries again for 24 hours, then marks the call Failed. A success (200 to 299) is Delivered. A redirect, any other refusal, or an address on a private network is Skipped and not tried again. Disabling the step skips calls not yet made. One step sends at most 3,000 an hour, and your store 10,000.
What is kept
Recent calls, in the step's panel, shows each call's time, result, tries and answer code. The body of the other system's answer is never kept, and the record is deleted after 30 days.
Sending a test
Send a test sends one signed call with a made-up person, Sample Profile, at sample@example.com. Save your changes first.
Check our signature
Every call is signed with your store's signing secret, so the receiver can check it came from your store. It carries three headers, following the Standard Webhooks specification: webhook-id, webhook-timestamp and webhook-signature. This is the check in JavaScript; it needs the body exactly as it arrived:
const crypto = require('node:crypto')
// secret: your signing secret, the whole value starting whsec_
// body: the request body exactly as it arrived, as text
function cameFromYourStore(secret, headers, body) {
const id = headers['webhook-id']
const timestamp = headers['webhook-timestamp']
const signatures = headers['webhook-signature'] || ''
// Refuse a call with no time on it, or more than five minutes old,
// so an old one cannot be replayed.
if (!/^\d+$/.test(timestamp || '') || Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false
const key = Buffer.from(secret.slice('whsec_'.length), 'base64')
const expected = crypto
.createHmac('sha256', key)
.update(id + '.' + timestamp + '.' + body)
.digest()
return signatures.split(' ').some((part) => {
if (!part.startsWith('v1,')) return false
const given = Buffer.from(part.slice('v1,'.length), 'base64')
return given.length === expected.length && crypto.timingSafeEqual(given, expected)
})
}The Standard Webhooks project publishes the same check for most other languages.
Your signing secret
Your store's signing secret is made when its first webhook is saved, and shown once: copy it into the receiving system before you close the dialog. To replace it, go to Settings → Integrations, under Webhook signing. For 24 hours after, calls are signed with both the old and new secret.
When something goes wrong
Recent calls shows each call's answer code, which usually says where the trouble is; the other system's support can say what it means. Send a test tries again once it is fixed.