{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://api.productfruits.com/schemas/survey-webhook-payload", "title": "Survey Webhook Payload", "description": "Webhook payload sent when a new survey answer is received", "type": "object", "properties": { "type": { "type": "string", "const": "webhook:newsurveyanswer", "description": "Event type identifier" }, "data": { "type": "object", "properties": { "projectCode": { "type": "string", "description": "Workspace identifier" }, "surveyId": { "type": "string", "format": "uuid", "description": "GUID of the survey" }, "authorName": { "type": "string", "description": "Name of the respondent" }, "authorEmail": { "type": "string", "format": "email", "description": "Email of the respondent" }, "authorUsername": { "type": "string", "description": "Username of the respondent" }, "answers": { "type": "array", "description": "Array of answers to survey questions", "items": { "type": "object", "properties": { "questionId": { "type": "string", "format": "uuid", "description": "GUID of the question" }, "questionType": { "type": "string", "enum": ["emo", "nps", "scale", "txt", "ltxt", "chk", "rbtn", "stat"], "description": "Type of question: emo=emoticons, nps=NPS, scale=numeric scale, txt=single-line text, ltxt=multi-line text, chk=multiple choice, rbtn=single choice, stat=message (no input)" }, "answer": { "description": "Answer value (type varies by questionType: string for emo/txt/ltxt/rbtn, integer 0-10 for nps, integer for scale, array of option IDs for chk, null for stat)", "oneOf": [ { "type": "string" }, { "type": "integer" }, { "type": "array", "items": { "type": "string" } }, { "type": "null" } ] }, "other": { "type": "string", "description": "Custom text for 'other' selections (optional)" } } } } } } } }