Response webhook: every response in your system as soon as it arrives

9 min read82
Copy for AI:

The responses API lets your system fetch responses whenever it wants. The webhook goes the other way: WiseData NPS sends each response to a URL in your system as soon as it arrives, with no one having to poll. In this article's example, a store's ERP receives each score from the "Post-purchase NPS" survey and flags the customer's order right away.

The webhook is in Collect β€Ί Integrations, in the Response webhook section, on the same plans as the API: Business and Enterprise. Only account admins see and set it up; for everyone else the section doesn't appear. If the account goes back to a plan without the API, deliveries stop and the setup is kept: it works again after an upgrade.

Set it up

  1. In Collect β€Ί Integrations, click Set up webhook.
  2. In Your system's URL, enter the address that will receive the responses. It must start with https://, point to a public internet address and accept a JSON POST. Addresses on your internal network (such as localhost, 10.x or 192.168.x) are rejected.
  3. In Surveys, keep All surveys or pick Only the chosen surveys and check which. In the example, only "Post-purchase NPS".
  4. Click Save webhook.

The first time you save, the screen shows the signing secret (it starts with whsec_) only once: copy it and store it in your system before clicking Got it, already copied. After that, the screen shows only the last four characters. Changing the URL later doesn't change the secret.

Each account has one webhook. The Webhook on switch, in the form, pauses deliveries without deleting the setup.

The two events

  • response.created β€” the response has just arrived, through any channel (email, WhatsApp, link, QR sign, kiosk, website widget or app).
  • response.analyzed β€” the AI finished analyzing the comment, a few hours later. It arrives with sentiment and topics filled in. A response without a comment isn't analyzed, so it doesn't trigger this event.

Responses from the survey's test sends don't trigger events.

What reaches your system

Each event is a POST with two headers β€” Content-Type: application/json and Signature (see below) β€” and this body:

{
  "id": "resp_8812.created",
  "type": "response.created",
  "occurred_at": "2026-11-23T10:15:02-03:00",
  "data": {
    "response_id": 8812,
    "survey_id": "01jd8zq6x9m3t4v7c2b5n8k1wr",
    "responded_at": "2026-11-23T10:15:00-03:00",
    "metric": "nps",
    "score": 4,
    "category": "detractor",
    "comment": "Took too long to arrive",
    "follow_up_answer": null,
    "sentiment": null,
    "channel": "email",
    "contact_id": 3051,
    "external_id": "C-00123",
    "external_account_id": "EMP-9",
    "name": "Ana Souza",
    "email": "ana@example.com",
    "phone": "+5511999999999",
    "updated_at": "2026-11-23T10:15:00-03:00",
    "analyzed": false,
    "topics": [],
    "answers": null
  }
}

Outside data:

  • id β€” the event code: resp_ + response number + .created or .analyzed. A repeat of the same event arrives with the same id.
  • type β€” response.created or response.analyzed (from the test button, response.test).
  • occurred_at β€” when the event was generated.

data is exactly one item from the responses API β€” the same fields, with the same names, as the CSV from the results screen, plus four more:

  • response_id β€” the response number. Use it to update the response you already have instead of duplicating it.
  • survey_id β€” the survey code.
  • responded_at β€” date and time in your account's time zone, with the offset written out.
  • metric β€” nps, csat or ces.
  • score β€” the score. In a questionnaire, the score of the NPS question, when there is one.
  • category β€” the score range: promoter, passive or detractor for NPS; satisfied, neutral or dissatisfied for CSAT; low_effort, moderate_effort or high_effort for CES. Without a score, null.
  • comment and follow_up_answer β€” the comment and the answer to the follow-up question, exactly as the person wrote them; null when there are none.
  • sentiment β€” the AI analysis: positive, neutral, negative or mixed; null until the analysis finishes.
  • channel β€” email, whatsapp, link (open link and QR sign), kiosk, embed (website widget) or app.
  • contact_id β€” the contact's code here in WiseData NPS.
  • external_id and external_account_id β€” the contact's external ID and the customer's, which you saved on the contact. In widget or app responses, external_id carries the user ID your site or app sent.
  • name, email and phone β€” who answered.
  • updated_at β€” the response's last change (its arrival, or the end of the analysis).
  • analyzed β€” true once the AI has analyzed it.
  • topics β€” the topics the AI found in the comment, as a list of strings.
  • answers β€” questionnaires only: one entry per question, with question_id, question (the question text), type and value. value is a number for scale and NPS, true/false for yes/no, text for open answers, a list of chosen options (option_id, label, text) for choice questions, and a list of rows (row_id, label, value) for matrices. An unanswered question comes with a null value. Outside questionnaires, null.

A field without a value comes as null β€” fields never disappear. In an anonymous survey, the six fields that identify the person (from contact_id to phone) come as null, and responded_at and updated_at carry only the date. The exception is someone who left their own contact asking to be called back: then the name, email and phone the person wrote come through, never the IDs.

Check the signature

The Signature header is the HMAC SHA-256 of the request body, in hexadecimal, computed with your secret. Recompute it on your side and only accept the delivery if it matches: that's what guarantees the caller was WiseData NPS and not someone who found the URL.

Compute it over the body exactly as it arrived, before parsing it. The JSON is sent with accents and slashes escaped ("Γ“timo \/ rΓ‘pido"); if your system parses the body and builds the JSON again, the bytes change and the signature won't match.

// PHP
$expected = hash_hmac('sha256', file_get_contents('php://input'), $secret);
$valid = hash_equals($expected, $_SERVER['HTTP_SIGNATURE'] ?? '');

// Node.js (in Express, read the raw body with express.raw({ type: 'application/json' }))
const expected = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
const received = req.headers['signature'] ?? '';
const valid = received.length === expected.length
  && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(received));

Compare the length before timingSafeEqual: with different lengths (a delivery without the header, for example), it throws an error instead of returning false.

The signature doesn't expire: someone who captures a delivery can resend it as is. That's why you should keep the ids you've processed and discard repeats.

If the secret leaks, click Change secret. The old secret stops working immediately: update it in your system right away. Deliveries already queued at the time of the change arrive signed with the old secret.

Deliveries, repeats and order

  • Answer 2xx quickly. A delivery waits up to 5 seconds for your answer. Store what arrived and process it later. The content of your answer is ignored: only the status matters.
  • Retries: if your system is down or answers with an error, the delivery is retried two more times β€” the second about 10 seconds after the first, the third about 100 seconds after the second.
  • Duplicates: a retry arrives with the same id (resp_8812.created). Ignore what you've already processed.
  • Order: in rare cases, response.analyzed can arrive before response.created. Compare data.updated_at and keep the newest version of the response, by response_id.
  • Redirects aren't followed. If the URL answers 301 or 302, the delivery counts as failed. Set the final address.
  • An address that started pointing inward. The address is checked again on every delivery. If the name started pointing to an internal network, the delivery isn't made and isn't retried.

The section shows the Last delivery and, if any, the Last failure, with the status your system returned (for example, HTTP 410). If the webhook was down for a while, use the API with updated_since to fetch what you missed: nothing is lost.

To see each attempt, open View API usage (at the top of Integrations) and the Webhook deliveries tab. Each row is one attempt: date, event (with the same id that arrives in the body, such as resp_8812.created, so you can find the delivery in your logs), response number, which attempt it was (#1, #2, #3), the result (Delivered, Failed or Destination blocked), the status your system returned and the duration. An attempt that failed but will be retried is marked "will retry"; sends from the test button are marked Test. You can filter by result and by event. The history is kept for 90 days and doesn't include the URL or the body sent or received.

Test before relying on it

Click Send test. A response.test event goes out right away, signed like the real ones, with a dummy response (response_id equal to 0). The screen tells you what your system answered. A test doesn't count as a delivery. The button accepts up to 10 sends per minute.

Where to go next

  • Integrations via API β€” the token, fetching responses with updated_since and finding a contact by your system's ID.
  • Results and reports β€” the CSV columns, which are the same fields as the webhook.
  • Scheduled report β€” the same CSV by email, for those who still import a file.

In short: in Collect β€Ί Integrations, an admin enters the URL and stores the secret; each response reaches your system right away (response.created) and again with the AI analysis (response.analyzed), with the same fields as the CSV, signed in the Signature header and with an id to discard duplicates.

Was this article helpful?