Skip to content

Webhook events

Every webhook event UserLoop sends, when it fires, and the fields of its body.

UserLoop sends each event as a POST with a JSON body to every webhook endpoint subscribed to it. Verify the signature before you trust a body, and see Retries, duplicates and ordering for what happens when your endpoint doesn’t answer.

Event When it fires
response.new Each response (one answer to one question) as it arrives, before the respondent finishes the survey.
response.completed A submission (one customer’s answers to the survey) settled: 15 seconds after its final answer, 90 seconds after its last answer, at most 15 minutes after its first.
response.updated More answers arrived after the submission settled.
response.low_score Sent with response.completed when a number score answer is low (NPS 0 to 6, else the bottom quarter of the scale).
survey.published A survey was published (made live, or its live version replaced).
survey.unpublished A live survey was unpublished, switched off, archived or deleted.
webhook.test Sent by Send test and when an endpoint is created.

Headers

Every event is sent with these headers:

Header Description
UserLoop-Event The event type.
UserLoop-Event-Id The event’s ID, the same on every retry and for every endpoint: dedupe on it.
UserLoop-Delivery One attempt series to one endpoint.
UserLoop-Signature t=<unix seconds>,v1=<hex HMAC-SHA256 of “<t>.<raw body>” with the endpoint’s secret>; two v1 values while a secret is rolled. Reject a t more than 300 seconds from your clock.

Answering: Any 2xx within 10 seconds is success; 410 Gone removes the subscription.

Envelope

Every event’s body has the same outer fields. The fields of data depend on the event and are listed under each one.

Field Type Always Description
id string Yes The event’s ID (evt_…), the same on every retry and endpoint: dedupe on it.
type string Yes The event type, for example response.new.
api_version "v1" (always) Yes
created_at string Yes ISO 8601 UTC timestamp.
organisation_id string Yes The organisation’s ID (org_…).
data object Yes The event’s own fields: see each event below.
truncated true (always) No Present when answers were left out of data to keep the body within 256 KB.

To see real bodies, GET /webhooks/samples/{event_type} returns samples of an event type (API reference).

response.new

A new response. Each response (one answer to one question) as it arrives, before the respondent finishes the survey.

data: one answer, as it arrives.

Field Type Always Description
response_id string Yes The submission the answer belongs to; resolves with GET /v1/responses/{response_id}.
survey object Yes The survey a response belongs to.
survey.public_id string or null Yes The survey’s public ID, as responses carry it.
survey.title string Yes The survey’s current title (“Deleted survey” or “Unknown survey” when it can’t be named).
received_at string Yes When the answer arrived.
final boolean Yes True when it is the survey’s last answer.
answer object Yes One answer of a submission.
answer.question_id string No The question’s public ID.
answer.question string Yes The question’s current wording, else as the customer saw it.
answer.type string No The question type: info_screen, single_select, multi_select, open_ended, email, phone, date, number_score, csat or video.
answer.answer array of string No Chosen answers, or the one written answer, date or email. Absent for scores.
answer.answer_ids array of string No IDs of the chosen answers (choice questions). Only identifiers: text an older survey stored in their place is in answer.
answer.score number No The score given (number score and NPS questions).
answer.other_text string No Text typed with an “Other” answer.
answer.video_url string No Playback URL of a video answer.

response.completed

A submission was completed. A submission (one customer’s answers to the survey) settled: 15 seconds after its final answer, 90 seconds after its last answer, at most 15 minutes after its first.

data: one submission: a customer’s answers to one survey in one sitting. Each answer row in it is a response (each Multi Select option ticked is one).

Field Type Always Description
response_id string Yes The submission’s ID: the row ID of its earliest answer.
survey object Yes The survey a response belongs to.
survey.public_id string or null Yes The survey’s public ID, as responses carry it.
survey.title string Yes The survey’s current title (“Deleted survey” or “Unknown survey” when it can’t be named).
received_at string No When the latest answer arrived.
started_at string No When the first answer arrived, when earlier than received_at.
channel string No Where it was answered: thank_you (Thank you page), order_status (Order status page), checkout (Checkout), link (Link), website (Website), email (Email), popup (Popup), app_block (App block), feedback_tab (Feedback tab), sdk (SDK), api (API), imported (brought in from another system) or other (see surface). The same values the channel filter takes. One of thank_you, order_status, checkout, link, website, email, popup, app_block, feedback_tab, sdk, api, imported, other.
surface string No With channel other: the surface as stored.
customer object Yes Who answered. Fields without a value are left out.
customer.name string No Full name, or initials when masked.
customer.email string No Email address, or masked (ja**@ex*****.com) unless include_contact_details is true.
customer.shopify_customer_id string No
customer.anonymous true (always) No Present when the submission carries no name or email.
customer.masked true (always) No Present when the name and email are masked.
order object No The order the submission is attached to.
order.order_id string No Shopify order ID.
order.order_number number No
order.total number No
order.currency string No
order.products array of string No Line items, at most 10.
order.more_products integer No How many line items were left out.
order.discount_code string No
order.discount_amount number No
attribution object No UTM values and landing page.
attribution.source string No utm_source.
attribution.medium string No utm_medium.
attribution.campaign string No utm_campaign.
attribution.term string No utm_term.
attribution.content string No utm_content.
attribution.landing_site string No The landing page.
answers array of object No
answers[].question_id string No The question’s public ID.
answers[].question string Yes The question’s current wording, else as the customer saw it.
answers[].type string No The question type: info_screen, single_select, multi_select, open_ended, email, phone, date, number_score, csat or video.
answers[].answer array of string No Chosen answers, or the one written answer, date or email. Absent for scores.
answers[].answer_ids array of string No IDs of the chosen answers (choice questions). Only identifiers: text an older survey stored in their place is in answer.
answers[].score number No The score given (number score and NPS questions).
answers[].other_text string No Text typed with an “Other” answer.
answers[].video_url string No Playback URL of a video answer.

response.updated

A submission got more answers. More answers arrived after the submission settled.

data: A settled submission that got more answers: every answer so far.

Field Type Always Description
response_id string Yes The submission’s ID: the row ID of its earliest answer.
survey object Yes The survey a response belongs to.
survey.public_id string or null Yes The survey’s public ID, as responses carry it.
survey.title string Yes The survey’s current title (“Deleted survey” or “Unknown survey” when it can’t be named).
received_at string No When the latest answer arrived.
started_at string No When the first answer arrived, when earlier than received_at.
channel string No Where it was answered: thank_you (Thank you page), order_status (Order status page), checkout (Checkout), link (Link), website (Website), email (Email), popup (Popup), app_block (App block), feedback_tab (Feedback tab), sdk (SDK), api (API), imported (brought in from another system) or other (see surface). The same values the channel filter takes. One of thank_you, order_status, checkout, link, website, email, popup, app_block, feedback_tab, sdk, api, imported, other.
surface string No With channel other: the surface as stored.
customer object Yes Who answered. Fields without a value are left out.
customer.name string No Full name, or initials when masked.
customer.email string No Email address, or masked (ja**@ex*****.com) unless include_contact_details is true.
customer.shopify_customer_id string No
customer.anonymous true (always) No Present when the submission carries no name or email.
customer.masked true (always) No Present when the name and email are masked.
order object No The order the submission is attached to.
order.order_id string No Shopify order ID.
order.order_number number No
order.total number No
order.currency string No
order.products array of string No Line items, at most 10.
order.more_products integer No How many line items were left out.
order.discount_code string No
order.discount_amount number No
attribution object No UTM values and landing page.
attribution.source string No utm_source.
attribution.medium string No utm_medium.
attribution.campaign string No utm_campaign.
attribution.term string No utm_term.
attribution.content string No utm_content.
attribution.landing_site string No The landing page.
answers array of object No
answers[].question_id string No The question’s public ID.
answers[].question string Yes The question’s current wording, else as the customer saw it.
answers[].type string No The question type: info_screen, single_select, multi_select, open_ended, email, phone, date, number_score, csat or video.
answers[].answer array of string No Chosen answers, or the one written answer, date or email. Absent for scores.
answers[].answer_ids array of string No IDs of the chosen answers (choice questions). Only identifiers: text an older survey stored in their place is in answer.
answers[].score number No The score given (number score and NPS questions).
answers[].other_text string No Text typed with an “Other” answer.
answers[].video_url string No Playback URL of a video answer.
generation integer Yes 1 for the first set of answers after the submission settled, then 2 …

response.low_score

A submission with a low score. Sent with response.completed when a number score answer is low (NPS 0 to 6, else the bottom quarter of the scale).

data: A completed submission with a low number score.

Field Type Always Description
response_id string Yes The submission’s ID: the row ID of its earliest answer.
survey object Yes The survey a response belongs to.
survey.public_id string or null Yes The survey’s public ID, as responses carry it.
survey.title string Yes The survey’s current title (“Deleted survey” or “Unknown survey” when it can’t be named).
received_at string No When the latest answer arrived.
started_at string No When the first answer arrived, when earlier than received_at.
channel string No Where it was answered: thank_you (Thank you page), order_status (Order status page), checkout (Checkout), link (Link), website (Website), email (Email), popup (Popup), app_block (App block), feedback_tab (Feedback tab), sdk (SDK), api (API), imported (brought in from another system) or other (see surface). The same values the channel filter takes. One of thank_you, order_status, checkout, link, website, email, popup, app_block, feedback_tab, sdk, api, imported, other.
surface string No With channel other: the surface as stored.
customer object Yes Who answered. Fields without a value are left out.
customer.name string No Full name, or initials when masked.
customer.email string No Email address, or masked (ja**@ex*****.com) unless include_contact_details is true.
customer.shopify_customer_id string No
customer.anonymous true (always) No Present when the submission carries no name or email.
customer.masked true (always) No Present when the name and email are masked.
order object No The order the submission is attached to.
order.order_id string No Shopify order ID.
order.order_number number No
order.total number No
order.currency string No
order.products array of string No Line items, at most 10.
order.more_products integer No How many line items were left out.
order.discount_code string No
order.discount_amount number No
attribution object No UTM values and landing page.
attribution.source string No utm_source.
attribution.medium string No utm_medium.
attribution.campaign string No utm_campaign.
attribution.term string No utm_term.
attribution.content string No utm_content.
attribution.landing_site string No The landing page.
answers array of object No
answers[].question_id string No The question’s public ID.
answers[].question string Yes The question’s current wording, else as the customer saw it.
answers[].type string No The question type: info_screen, single_select, multi_select, open_ended, email, phone, date, number_score, csat or video.
answers[].answer array of string No Chosen answers, or the one written answer, date or email. Absent for scores.
answers[].answer_ids array of string No IDs of the chosen answers (choice questions). Only identifiers: text an older survey stored in their place is in answer.
answers[].score number No The score given (number score and NPS questions).
answers[].other_text string No Text typed with an “Other” answer.
answers[].video_url string No Playback URL of a video answer.
low_score object Yes The low score: NPS 0 to 6, else the bottom quarter of the scale.
low_score.question_id string Yes The number score question’s public ID.
low_score.score number Yes

survey.published

A survey was published. A survey was published (made live, or its live version replaced).

data: the survey that was published.

Field Type Always Description
id string Yes ID: the survey_id other tools take.
public_id string Yes The ID responses carry.
title string Yes
status string Yes draft, active (live) or archived. One of draft, active, archived.
format string Yes Where the survey runs. One of checkout, popup, app_block, link, email, website.
live_on array of string Yes Where it is live now: checkout, popup, app_block, link, email or website.
question_count integer Yes Active main questions.
follow_up_count integer Yes
published_version integer or null Yes
live_since string or null Yes
last_published_at string or null Yes
link_url string or null Yes The shareable link of a link or email survey.
languages array of string Yes Translation languages, two-letter codes.
updated_at string or null Yes
version integer Yes The published version.

survey.unpublished

A survey was taken offline. A live survey was unpublished, switched off, archived or deleted.

data: the survey that was taken offline.

Field Type Always Description
id string Yes ID: the survey_id other tools take.
public_id string Yes The ID responses carry.
title string Yes
status string Yes draft, active (live) or archived. One of draft, active, archived.
format string Yes Where the survey runs. One of checkout, popup, app_block, link, email, website.
live_on array of string Yes Where it is live now: checkout, popup, app_block, link, email or website.
question_count integer Yes Active main questions.
follow_up_count integer Yes
published_version integer or null Yes
live_since string or null Yes
last_published_at string or null Yes
link_url string or null Yes The shareable link of a link or email survey.
languages array of string Yes Translation languages, two-letter codes.
updated_at string or null Yes
deleted true (always) No Present when the survey was deleted: live_on is empty and link_url null.

webhook.test

A test event. Sent by Send test and when an endpoint is created.

data: A test message.

Field Type Always Description
message string Yes

Type to search…

↑↓ navigate↵ selectEsc close