Admin

Create a new question (with optional inline options)

Changed on
post/api/admin/questionnaire/questions

Request

  • Base URL
    https://api.rewritelifestyle.ai (the document declares no server; this is the origin it was published from)
  • URL
    https://api.rewritelifestyle.ai/api/admin/questionnaire/questions
  • Auth
    HTTP bearer

Request body

surveyIdnumber

Survey this question belongs to — defaults to the intake survey if omitted

questionTextstring required
questionKeystring required
answerTypestring required
minItemsnumber

Minimum items required — only meaningful for answerType "repeatable_list"

allowsCustomInputboolean
sectionnumber
displayOrdernumber
isRequiredboolean
conditionalOnQuestionIdnumber

ID of question this depends on

conditionalOnOptionIdsstring[]

Option IDs that make this question visible

Example request

{
  "surveyId": 1,
  "questionText": "What type of bariatric surgery did you have?",
  "questionKey": "surgery_type",
  "answerType": "single_choice",
  "minItems": 5,
  "section": 1,
  "displayOrder": 1,
  "isRequired": true,
  "conditionalOnQuestionId": 12,
  "conditionalOnOptionIds": [
    1,
    2,
    3
  ],
  "options": [
    {
      "optionText": "Gastric Sleeve",
      "optionValue": "gastric_sleeve",
      "displayOrder": 1
    }
  ]
}

Changes

    • info

      added the new optional request property

    • info

      added the new optional request property