Skip to content
Open Screeb

Receive survey displays, answers and completed responses on your own endpoint, and check that each request comes from Screeb.

A webhook sends an HTTP POST request to your endpoint each time something happens in a survey. Use it to feed your backend or an automation tool with responses in real time.

Admins add webhooks in the Screeb admin, for the whole workspace, for one survey or for one question. The help center walks through the setup. This page covers what your endpoint receives.

Event event_type When Screeb sends it
Survey displayed response.displayed A survey is shown to a user, even if they never answer.
Question answered response.answered A question is answered. Sent once per answered question.
Response ended response.ended The user completed or closed the survey.

Each webhook has a payload version, chosen when it is added. Use the latest one for a new endpoint.

Version What changes
v2.1.0 User properties, response context and hidden fields come as three separate, nested objects.
v2.0.0 respondent becomes user, and answers list all their values in fields.
v1.3.0 The first documented version, still sent to webhooks set up on it.

Every request has a JSON body and these headers:

Content-Type: application/json
Accept: application/json
User-Agent: screeb-webhook/<event>/<version>

<event> is response.created (for displays), response.answered or response.ended. The custom headers set on the webhook in the admin come with them.

Your endpoint has 15 seconds to answer with a 2xx status. When it answers 429, a 5xx, or does not answer in time, Screeb retries up to 3 times, after about 30 seconds, 2.5 minutes, then 12.5 minutes. Any other 4xx status is final: Screeb does not retry.

Since a request can arrive more than once, process each event_id once.

When the Webhook integration is installed in the workspace, Screeb signs every request with its signature secret, shown on the integration page. Check the signature to be sure the request comes from Screeb and was not modified on the way.

Each signed request carries three headers:

X-Screeb-Hmac-Digest: HMAC-SHA256-BASE64
X-Screeb-Hmac-Signature-Url: k8TREZiVCkqywuUT1Lmxa4exhXOf0IS24ibxDIJ3ka8=
X-Screeb-Hmac-Signature-Body: 8l1n5Gb9U3mmS3oVhy2u5kyZ8vtN0X0f3+TKe1CYv2o=
  • X-Screeb-Hmac-Signature-Body is the HMAC-SHA256 of the raw request body, keyed with the secret, encoded in base64.
  • X-Screeb-Hmac-Signature-Url is the same signature of the webhook URL.

Compute the signature over the raw body, before any JSON parsing: parsing and serializing again changes the bytes. An example with Node.js and Express:

import crypto from "node:crypto";
import express from "express";
const app = express();
app.post("/screeb-webhook", express.raw({ type: "application/json" }), (req, res) => {
const expected = crypto
.createHmac("sha256", process.env.SCREEB_WEBHOOK_SECRET)
.update(req.body)
.digest();
const received = Buffer.from(req.header("x-screeb-hmac-signature-body") ?? "", "base64");
if (received.length !== expected.length || !crypto.timingSafeEqual(received, expected)) {
res.status(403).json({ message: "invalid signature" });
return;
}
const event = JSON.parse(req.body.toString("utf8"));
console.log(event.event_type, event.event_id);
res.sendStatus(200);
});
app.listen(3000);

For any question or extra need, contact us through the chat in the Screeb admin (Help and docs, then Talk to a human).