update_survey
Update an existing survey. Partial update: only the fields you send are touched — EXCEPT questions, which is a FULL REPLACEMENT of the entire question set (sending [] deletes all questions; omitting it leaves them untouched). If the survey already has responses its structure is locked: replacing questions is rejected with 409 — do not retry, explain to the user that responses protect the structure. At least one of survey_name, status, archived, settings or questions is required. Use status false to disable a survey without losing data (the safe alternative to delete_survey). Visual configuration (Visuals/Pages/LogoFile) is ignored here. Requires the Surveys module enabled — on 403 "module is not enabled", do NOT retry; tell the user to contact Sweeppea support. DISPLAY RULE: never show SurveyToken UUIDs.
update_survey
When to use
Update an existing survey. Partial update: only the fields you send are touched — EXCEPT questions, which is a FULL REPLACEMENT of the entire question set (sending [] deletes all questions; omitting it leaves them untouched). If the survey already has responses its structure is locked: replacing questions is rejected with 409 — do not retry, explain to the user that responses protect the structure. At least one of survey_name, status, archived, settings or questions is required. Use status false to disable a survey without losing data (the safe alternative to delete_survey). Visual configuration (Visuals/Pages/LogoFile) is ignored here. Requires the Surveys module enabled — on 403 "module is not enabled", do NOT retry; tell the user to contact Sweeppea support. DISPLAY RULE: never show SurveyToken UUIDs.
Pre-calls required
get_survey— check IsLocked before attempting to replace questions
Parameters to validate before calling
survey_token(string, required) — The survey token (UUID v4) of the survey to updatesurvey_name(string, optional) — New survey name (max 200 characters, cannot be emptied, optional)status(boolean, optional) — true enables, false disables the survey (optional)archived(boolean, optional) — true archives, false restores (optional)settings(object, optional) — Settings object with PascalCase keys (written key-by-key, only sent keys change): Description, QuestionsPerPage (1-5), CollectContactInfo, ShowProgressBar, ShuffleQuestions, AllowMultipleResponses, ThankYouMessage, RedirectUrl, StartDate, EndDate, MaxResponses, ShowCountdown, EnableSharing, Language ("en"|"es") (optional)questions(array, optional) — FULL REPLACEMENT of the question set — rejected with 409 if the survey has responses. PascalCase keys per item: {"QuestionText" (required), "FieldType" (required: text|textarea|radio|checkbox|select|slider|rating|nps|yesno|date), "Page", "QuestionDescription", "Layout", "Required", "Options": [each option is an object {"Label": "..."}], "Settings": {...}} (optional)
Notes
questionsis a FULL REPLACEMENT of the question set — sending [] deletes all questions; omitting it leaves them untouchedEach Option is an object with a Label key, e.g. "Options": [{"Label": "Friend"}, {"Label": "Social media"}] — never plain strings
409 when the survey has responses: the structure is locked to protect collected data — do not retry
To disable a survey without losing data use status false (the safe alternative to delete_survey)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | true enables, false disables the survey (optional) | |
| archived | No | true archives, false restores (optional) | |
| settings | No | Settings object with PascalCase keys (written key-by-key, only sent keys change): Description, QuestionsPerPage (1-5), CollectContactInfo, ShowProgressBar, ShuffleQuestions, AllowMultipleResponses, ThankYouMessage, RedirectUrl, StartDate, EndDate, MaxResponses, ShowCountdown, EnableSharing, Language ("en"|"es") (optional) | |
| questions | No | FULL REPLACEMENT of the question set — rejected with 409 if the survey has responses. PascalCase keys per item: {"QuestionText" (required), "FieldType" (required: text|textarea|radio|checkbox|select|slider|rating|nps|yesno|date), "Page", "QuestionDescription", "Layout", "Required", "Options": [...], "Settings": {...}} (optional) | |
| survey_name | No | New survey name (max 200 characters, cannot be emptied, optional) | |
| survey_token | Yes | The survey token (UUID v4) of the survey to update |