NueForm

Webhook Payloads

NueForm webhook payload schemas का पूर्ण reference, जिसमें form.submitted event structure, question type के अनुसार answer formats, और quiz results शामिल हैं।

प्रत्येक NueForm webhook request body में JSON payload भेजता है। यह page प्रत्येक event type के लिए पूर्ण payload schema document करता है।

Common Structure

सभी webhook payloads ये top-level fields share करते हैं:

FieldTypeविवरण
eventstringEvent type (जैसे, form.submitted)
formIdstringForm की unique ID
formTitlestringSubmission के समय form का title
responseIdstringResponse की unique ID
answersarrayAnswer objects का array
respondentobject या nullLogged-in respondent की identity, जब form को login require था। Anonymous submissions के लिए null। देखें Respondent Identity।
submittedAtstringEvent dispatch होने का ISO 8601 timestamp

form.submitted Payload

जब respondent complete form response submit करता है तब यह payload भेजा जाता है।

Full Example

json
{
  "event": "form.submitted",
  "formId": "507f1f77bcf86cd799439011",
  "formTitle": "Customer Feedback Survey",
  "responseId": "507f1f77bcf86cd799439022",
  "answers": [
    {
      "questionId": "507f1f77bcf86cd799439033",
      "value": "Jane Doe",
      "label": "What's your name?",
      "type": "short_text"
    },
    {
      "questionId": "507f1f77bcf86cd799439044",
      "value": "jane@example.com",
      "label": "What's your email address?",
      "type": "email"
    },
    {
      "questionId": "507f1f77bcf86cd799439055",
      "value": 4,
      "label": "How would you rate your experience?",
      "type": "rating"
    },
    {
      "questionId": "507f1f77bcf86cd799439066",
      "value": "The onboarding flow was smooth and intuitive.",
      "label": "What did you like most?",
      "type": "long_text"
    },
    {
      "questionId": "507f1f77bcf86cd799439077",
      "value": ["c3a1e5f2-8b4d-4f6a-9e21-7d0b3c8a5f14", "9b7e2d41-5c3f-4a8e-b6d0-1f2a4c6e8b93"],
      "label": "Which features do you use?",
      "type": "multiple_choice"
    },
    {
      "questionId": "507f1f77bcf86cd799439088",
      "value": true,
      "label": "Would you recommend us?",
      "type": "yes_no"
    }
  ],
  "respondent": {
    "id": "507f1f77bcf86cd799439016",
    "name": "Jane Smith",
    "email": "jane@example.com",
    "auth_method": "sso"
  },
  "submittedAt": "2025-03-15T14:32:07.123Z"
}

Field Reference

Top-Level Fields

event --- string

इस event type के लिए हमेशा "form.submitted"।

formId --- string

Form की MongoDB ObjectId। यह 24-character hexadecimal string है।

formTitle --- string

Webhook fire होने के समय form का human-readable title। ध्यान दें कि यदि आप बाद में form rename करते हैं, पहले delivered webhooks में अभी भी पुराना title होगा।

responseId --- string

Stored response की MongoDB ObjectId। आप इसे Responses API के माध्यम से full response fetch करने या webhook deliveries deduplicate करने के लिए idempotency key के रूप में उपयोग कर सकते हैं।

submittedAt --- string

Webhook dispatch होने का ISO 8601 timestamp। यह dispatch time पर generate होता है और database में response के submittedAt field के बहुत करीब (लेकिन necessarily identical नहीं) होगा।

respondent --- object या null

Logged-in user की identity जिसने response submit की, केवल तब expose होती है जब form ने login require किया था (requireLogin: true)। सभी anonymous submissions के लिए null। पूर्ण schema और behaviour के लिए नीचे Respondent Identity देखें।

Answer Objects

answers array में प्रत्येक entry एक single question का response represent करती है:

FieldTypeविवरण
questionIdstringQuestion की MongoDB ObjectId
valueanyRespondent का answer (format question type पर निर्भर)
labelstringकेवल web submissions में। Question का title, plain text के रूप में, उसी भाषा में जिसमें respondent ने जवाब दिया।
typestringकेवल web submissions में। Question type, जैसे short_text या matrix।
subLabelsobjectकेवल web submissions में, sub-fields वाले question के लिए, जैसे संपर्क जानकारी, पता या प्रश्न समूह। हर sub-field की ID को उसके label से जोड़ता है।
valueLabelsobjectWeb और phone call, दोनों तरह के submissions में, ऐसे question के लिए जिसकी choices, rows या columns किसी variable से आती हैं। तब value में item की values होती हैं, और यह map हर चुनी गई value का label देता है। Matrix में keys row:<value> और column:<value> होती हैं। Fixed lists वाले answers में यह नहीं होता।

Phone calls से आए answers में questionId, value और, variable से ली गई list के लिए, valueLabels होते हैं। Web answers में viewedAt और answeredAt भी हो सकते हैं — question कब दिखाया गया और कब उसका जवाब दिया गया, respondent के device के ISO 8601 timestamps के रूप में। समय के साथ और fields जुड़ सकते हैं, इसलिए जिन fields का आप उपयोग नहीं करते उन्हें ignore करें।

Variable से load हुई list का web answer ऐसा दिखता है:

json
{
  "questionId": "507f1f77bcf86cd799439099",
  "value": "siamese",
  "label": "Which breed is your cat?",
  "type": "dropdown",
  "valueLabels": { "siamese": "Siamese" }
}

Phone call पर दिया गया वही answer label और type के बिना आता है।

Question Type के अनुसार Answer Values

प्रत्येक answer object में value field question type पर निर्भर करता है। यहां प्रत्येक type के लिए format है:

Text Inputs

Question TypeValue TypeExample
short_textstring"Jane Doe"
long_textstring"I really enjoyed the product..."
emailstring"jane@example.com"
phonestring"+1 (555) 123-4567"
numbernumber42
urlstring"https://example.com"

Choice Questions

Question TypeValue TypeExample
multiple_choice (single)string"c3a1e5f2-8b4d-4f6a-9e21-7d0b3c8a5f14"
multiple_choice (multi)array<string>["c3a1e5f2-8b4d-4f6a-9e21-7d0b3c8a5f14", "__other__:Word of mouth"]
dropdown (single)string"e0c4a7d9-2f16-4b3e-8a57-c19d6f2b4e80"
dropdown (multi)array<string>["e0c4a7d9-2f16-4b3e-8a57-c19d6f2b4e80", "5d8f1b36-a9e2-4c07-b3d4-6e1a9f7c2b58"]
yes_nobooleantrue

value में choice IDs होती हैं, labels नहीं: question की choices में हर चुनी गई choice का id। Builder ये IDs UUID के रूप में बनाता है। API और MCP server बिना id वाली choice भी स्वीकार करते हैं, जैसे { "label": "Search engine" }; तब web answer के value में ID की जगह उस choice का label होता है। multiple_choice और dropdown एक single string भेजते हैं, या allowMultiple true होने पर strings का array। Image choices (layout: "blocks") भी multiple_choice questions ही हैं।

अगर respondent अन्य चुनता है, तो entry __other__: और उसके बाद respondent का लिखा text होती है, जैसा ऊपर के example में है। Phone call पर "अन्य" answer caller के अपने शब्दों में, बिना prefix के save होता है।

Webhooks किसी fixed list के labels नहीं भेजते। उन्हें दिखाने के लिए, हर ID को question की choices में खोजें, जो फॉर्म प्राप्त करें लौटाता है; बिना id वाली choice के लिए value में पहले से उसका label होता है। जब choices किसी variable से आती हैं, तो value में item values होती हैं और answer का valueLabels उनके labels देता है — Answer Objects देखें।

Rating Questions

Question TypeValue TypeExampleRange
ratingnumber41 से steps (default 5)
opinion_scalenumber7min से max
npsnumber90 से 10

Date और Time

Question TypeValue TypeExample
datestring"2025-03-15"

Date string format question पर configured dateFormat property से match करता है (default YYYY-MM-DD)।

Question TypeValue TypeExample
legalbooleantrue
statementstring"" (हमेशा empty --- statements कोई data collect नहीं करते)

Ranking

Question TypeValue TypeExample
rankingarray<string>["5d8f1b36-a9e2-4c07-b3d4-6e1a9f7c2b58", "c3a1e5f2-8b4d-4f6a-9e21-7d0b3c8a5f14", "71a4c9e0-3b5d-4f82-9c16-d2e8a0b7f345"]

Array में choice IDs respondent के चुने हुए order में होती हैं, first से last तक; web answer में, बिना id के save की गई choice ID की जगह अपने label के रूप में आती है। Labels से IDs को वैसे ही match करें जैसे Choice Questions में।

Matrix

Question TypeValue TypeExample
matrixobject{ "Speed": "Satisfied", "Price": "Neutral" }

Fixed rows और columns वाले Matrix में object हर row label को selected column label से map करता है। जब rows या columns किसी variable से आती हैं, तो यह row values को column values से map करता है, और respondent के देखे labels answer के valueLabels में row:<value> और column:<value> keys के नीचे होते हैं।

File Upload

Question TypeValue TypeExample
file_uploadstring"https://storage.nueform.io/uploads/abc123.pdf"

Value NueForm के storage में uploaded file का URL है।

Signature और Drawing

Question TypeValue TypeExample
signaturestring"data:image/png;base64,iVBOR..."
drawingstring"data:image/png;base64,iVBOR..."

दोनों captured image की base64-encoded PNG data URI return करते हैं।

Recording

Question TypeValue TypeExample
recordingstring"https://storage.nueform.io/recordings/abc123.webm"

Value uploaded recording file का URL है।

Composite Questions

Composite question types (contact_info, address, question_group, multi_question_page) एक ही answer entry produce करते हैं, composite question की अपनी questionId के साथ। उसका value एक object है, जिसकी keys sub-field IDs होती हैं। संपर्क जानकारी और पता first_name और zip_code जैसी built-in IDs उपयोग करते हैं; प्रश्न समूह या बहु-प्रश्न पृष्ठ अपने अंदर के हर question की ID उपयोग करता है। हर sub-field की value उसके अपने question type के format में होती है। Web answers में subLabels भी होता है, जो हर sub-field की ID को उसके label से जोड़ता है।

उदाहरण के लिए, एक contact_info question यह produce करता है:

json
{
  "questionId": "507f1f77bcf86cd7994390aa",
  "value": {
    "first_name": "Jane",
    "last_name": "Doe",
    "phone_number": "+1 555-0100",
    "email": "jane@example.com",
    "company": "Acme Inc."
  },
  "label": "How can we reach you?",
  "type": "contact_info",
  "subLabels": {
    "first_name": "First Name",
    "last_name": "Last Name",
    "phone_number": "Phone Number",
    "email": "Email",
    "company": "Company"
  }
}

Phone call पर दिया गया वही answer उसी value के साथ, लेकिन label, type और subLabels के बिना आता है।

Respondent Identity

जब एक form requireLogin: true के साथ configured होता है, तो हर accepted submission एक signed-in user से tied होता है। Webhook payloads form owners को respondent field के माध्यम से उस identity को expose करते हैं। अन्य सभी submissions के लिए field null होती है।

Schema

json
{
  "respondent": {
    "id": "507f1f77bcf86cd799439016",
    "name": "Jane Smith",
    "email": "jane@example.com",
    "auth_method": "sso"
  }
}
FieldTypeविवरण
idstringRespondent की user ID।
namestringRespondent के account पर display name।
emailstringRespondent के account पर email address।
auth_methodstringया तो "sso" या "login"। "sso" indicate करता है कि respondent SSO के माध्यम से form की team का member है; "login" किसी अन्य supported authentication method को indicate करता है।

respondent कब populated होता है

respondent केवल तब populate होता है जब:

  1. Form में requireLogin true set है, और
  2. Submitter ने submit करने से पहले sign in किया क्योंकि form ने require किया था।

जब requireSsoLogin भी true है, केवल वे users जो SSO के माध्यम से form की team के members हैं, submit step तक पहुँच सकते हैं, इसलिए हर populated respondent का auth_method: "sso" होगा।

respondent कब null होता है

Predictable downstream parsing के लिए field हमेशा JSON में present है, और इन में से कोई भी true होने पर null है:

  • Form ने login require नहीं किया था (requireLogin false था)।
  • Submitter anonymous था।
  • Response को post-submit consent flow ("इस response को claim करें" prompt) के माध्यम से save किया गया था। Consent-saved responses कभी भी identity attached के साथ webhook payloads में नहीं दिखाई देते — वे केवल user के "My Responses" view में store होते हैं और webhook receivers को expose नहीं किए जाते।

Webhook payloads केवल उन respondents के लिए identity expose करते हैं जो form ने require किया इसलिए logged in हुए। Post-submit consent के माध्यम से collected identities को respondent की privacy और owner की insight के बीच सीमा का सम्मान करने के लिए जानबूझकर webhooks से रोका जाता है।

Quiz Results

Quiz mode (knowledge_quiz, lead_qualification, या match_quiz) में चलने वाले forms के लिए, stored response में quizResults object शामिल होता है। हालांकि यह object webhook payload में directly शामिल नहीं है, आप इसे webhook से responseId उपयोग करके Responses API के माध्यम से retrieve कर सकते हैं।

quizResults object की निम्नलिखित structure है:

json
{
  "formMode": "knowledge_quiz",
  "score": 7,
  "correctAnswers": 7,
  "totalScorableQuestions": 10,
  "maxScore": 10,
  "matchedEndingId": "507f1f77bcf86cd799439099"
}
FieldTypeविवरण
formModestringQuiz mode: knowledge_quiz, lead_qualification, या match_quiz
scorenumberRespondent का total score
correctAnswersnumberCorrectly answer किए गए questions की संख्या (केवल knowledge quiz; अन्य modes के लिए 0)
totalScorableQuestionsnumberScore में contribute करने वाले questions की कुल संख्या
maxScorenumberMaximum achievable score
matchedEndingIdstring या undefinedRespondent के score के आधार पर दिखाई गई end screen की ID
endingTalliesobject या undefinedकेवल Match quiz: प्रत्येक end screen ID को उसकी tally count से map करता है

Metadata

Stored response में URL parameters के माध्यम से pass किए गए hidden fields युक्त metadata object भी शामिल हो सकता है। यह Responses API के माध्यम से उपलब्ध है लेकिन webhook payload में शामिल नहीं है।

json
{
  "hiddenFields": {
    "utm_source": "google",
    "utm_campaign": "spring_sale",
    "user_id": "ext_12345"
  }
}

Webhook-delivered response के लिए metadata access करने के लिए, responseId उपयोग करके fetch करें:

bash
curl https://app.nueform.io/api/v1/forms/FORM_ID/responses/RESPONSE_ID \
  -H "Authorization: Bearer nf_your_api_key"

HTTP Headers

प्रत्येक webhook request में ये HTTP headers शामिल होते हैं:

HeaderValue
Content-Typeapplication/json
X-NueForm-SignatureRaw request body का HMAC-SHA256 hex digest

Signature validate करने के तरीके के लिए Verification देखें।

Payload Size

Webhook payloads typically small (10 KB से कम) होते हैं। Size मुख्य रूप से questions की संख्या और text answers की length पर निर्भर करता है। File upload answers में URLs (file contents नहीं) होते हैं, इसलिए वे payload size significantly नहीं बढ़ाते।

Next Steps

  • Verification --- Webhook signatures validate करें
  • Testing --- Locally webhook payloads test करें
  • Events --- Event types और delivery guarantees
अंतिम अपडेट: 8 अक्टूबर 2026