NPS and rating responses from a forms partner
Send each survey answer as a $survey_response event and Lucida shows the NPS score, rating average, distribution and trend, split by any person property. Exact event shape, dedupe rule and copy-paste query bodies.
Lucida does not build surveys. Your forms product (FormFlow, Typeform or your own) owns the form. Each answer comes into Lucida as one $survey_response event, and the NPS and ratings insight reads it.
The event
Property | Required | Meaning |
|---|---|---|
| yes | The form id |
| yes | Your id for the question (stable across form versions) |
| yes |
|
| yes | The answer, by type (below) |
| recommended | The id of the whole submission. Needed to dedupe pull and push (below) |
| no | The question's wording, at most 200 characters. Used as the label of the question in the insight (breakdown |
| no | The form's version, so a reworded question can be told apart |
| no | The experiment and arm the respondent was in |
The same unprefixed names are used on $survey_completed (the whole-submission event a connector sends). Older connector events also carry $survey_id, $survey_submission_id, $experiment_id and $variant; queries read either spelling.
The response rule per question_type:
|
| Counted in the score when |
|---|---|---|
| a whole number 0 to 10 (a numeric string such as | it is an integer from 0 to 10. |
| a number (any scale you like; the average is of the raw value) | it is a number. Text such as |
| a string | never scored; kept for filters and exports |
| a list of strings | never scored |
Lucida accepts any response size that fits in one event (the capture limit of about 1 MB per event); there is no separate cap, so keep open answers reasonable.
Send it like any event, with the person's distinct_id, so it joins the person's other events and person properties:
lucida.capture("$survey_response", {
survey_id: "onboarding",
submission_id: "sub_8841",
question_id: "nps_main",
question_text: "How likely are you to recommend us?",
question_type: "nps",
response: 9,
form_version: 3,
});The latest score on the person
Lucida keeps three person properties up to date from nps answers. It is on by default; set nps_person_properties to false in the project's ingest settings to stop it (properties already set stay; all keys: Ingest settings reference):
Person property | Value |
|---|---|
| the score, 0 to 10 |
|
|
| the answer's timestamp (RFC 3339) |
curl -X PUT https://<host>/v1/projects/$PROJECT/settings/ingest \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"nps_person_properties": false}'Use them in cohorts, filters and breakdowns (nps_band = detractor). Rules:
With it off, nothing new is written to persons. Turning it back on does not backfill answers sent while it was off.
The latest answer by event timestamp wins, also when answers arrive out of order.
Only answers that count in the score (a whole number 0 to 10) are used. Ignored answers never touch the person.
Only for persons Lucida processes. An event sent with
$process_person_profile: falsehas no person, so it sets nothing.A
$setofnps_latestornps_bandon the same event wins over the derived value.
Dedupe: pull plus push
One answer is identified by (survey_id, submission_id, question_id). If a connector pulls a submission and your app also pushes it, the insight counts the answer once (the earliest event wins). Answers without a submission_id are never merged with each other. Events also dedupe by uuid, so a retried delivery does not double count.
Warnings at capture
A $survey_response the score would ignore is still stored. The capture response then carries a warnings entry (clients that ignore the field are unaffected):
{"status": 1, "warnings": [{"index": 0, "code": "survey_response_ignored", "reason": "nps_out_of_range", "uuid": "0192..."}]}reason is nps_out_of_range, nps_not_a_number or rating_not_a_number. A question_text over 200 characters gives survey_question_text_too_long. The insight reports how many answers were ignored with the series survey:ignored (below), and GET /v1/projects/{project_id}/surveys shows the count per form.
From FormFlow or Typeform
Add a questions setting to the connector, listing the fields to send:
{
"questions": {
"fld_nps": { "question_id": "nps_main", "question_type": "nps", "question_text": "How likely are you to recommend us?" },
"fld_stars": { "question_type": "rating" }
}
}The key is the FormFlow field id or the Typeform field ref. question_id defaults to that key. Only fields you list are read, the same opt-in as fields: an unlisted answer never reaches Lucida. Each completed response still produces one $survey_completed; each listed answer adds one $survey_response. If you also send from your own app, pass the same submission_id.
The insight
Open Insights and pick NPS and ratings:
Score and trend. For NPS the score is the share of promoters (9 or 10) minus the share of detractors (0 to 6), from -100 to 100, per period. For ratings it is the average rating.
Distribution. Answers per period split into promoters, passives (7 or 8) and detractors, or by rating value.
Breakdown. Split the score by any person property, such as plan or country.
Filters. Narrow to one question (
question_id) or one form (survey_id).Ignored. A sum of
survey:ignoredgives how many answers were stored but not scored.
It is a trends insight underneath. Derived properties: survey:nps (+100, 0, -100 per answer), survey:nps_band (promoter, passive, detractor), survey:ignored (1 or 0), survey:question (label), survey:id (form id).
Over the API
All bodies go to POST /v1/projects/{project_id}/query with Authorization: Bearer <key> (see Queries and insights over the API).
NPS score by week:
{"query": {
"kind": "trends",
"date_range": {"from": "2026-10-01T00:00:00Z", "to": "2026-11-01T00:00:00Z"},
"interval": "week",
"series": [{
"source": {"type": "event", "name": "$survey_response"},
"math": "avg",
"math_property": "survey:nps",
"filters": {"and": [{"key": "question_id", "op": "eq", "value": "nps_main"}]}
}]
}}NPS by a person property (plan):
{"query": {
"kind": "trends",
"date_range": {"from": "2026-10-01T00:00:00Z", "to": "2026-11-01T00:00:00Z"},
"interval": "week",
"series": [{
"source": {"type": "event", "name": "$survey_response"},
"math": "avg",
"math_property": "survey:nps",
"filters": {"and": [{"key": "question_type", "op": "eq", "value": "nps"}]}
}],
"breakdown": [{"key": "plan", "type": "person"}]
}}Distribution (promoters, passives, detractors):
{"query": {
"kind": "trends",
"date_range": {"from": "2026-10-01T00:00:00Z", "to": "2026-11-01T00:00:00Z"},
"interval": "week",
"series": [{
"source": {"type": "event", "name": "$survey_response"},
"filters": {"and": [{"key": "question_type", "op": "eq", "value": "nps"}]}
}],
"breakdown": [{"key": "survey:nps_band", "type": "event"}]
}}Ignored answers (stored, not scored): the same query with "math": "sum" and "math_property": "survey:ignored", and no filter.
Save the first one as an insight with POST /v1/projects/{project_id}/insights:
{
"name": "NPS by week",
"query": {
"kind": "trends",
"date_range": {"from": "-90d", "to": "now"},
"interval": "week",
"series": [{
"source": {"type": "event", "name": "$survey_response"},
"math": "avg",
"math_property": "survey:nps",
"filters": {"and": [{"key": "question_type", "op": "eq", "value": "nps"}]}
}]
}
}List the surveys Lucida has seen
GET /v1/projects/{project_id}/surveys?limit=50&cursor=... (read scope, same as other read routes) returns one row per survey_id seen in $survey_response events:
{"data": [{"survey_id": "onboarding", "last_response_at": "2026-11-02T09:14:00Z", "responses": 412, "ignored": 3}], "next_cursor": null}