Create a question

POST

https://www.rapidoform.com/be/api/question

All requests require X-EMAIL and X-API-KEY. See authentication and errors. JSON request bodies also require Content-Type: application/json. All IDs in examples are synthetic; replace them with your own values.

Parameters

NameType / locationDescription
surveyIdstringRequired form ID as a string.
questionOrdernumberRequired position; the initial welcome question occupies 0.
questionTextstringQuestion text.
questionTypestringExact builder type, for example Text Question or Selection Question.
descriptionstringOptional supporting text.
markOptionalbooleanOptional; true makes the answer optional.
choicesarrayFor selection questions: objects with numeric precode and string value. Optional translations map per choice.
selectionTypestringSingle Selections or Multiple Selections.
rulestringJSON-encoded logic configuration, for example "[]". Not a JSON array.

Use an active account and a form in your workspace. Type-specific fields supported at creation include optionRandomOrder, ratingScale, ratingType, schedulingUrl, translationLanguages, translations, stimuliMedia, rowItems, columnItems, setTimeMinimum, timeMinimum, setMinTextLength, minTextLength, setMaxTextLength, maxTextLength, mediaPlayback, setMediaMaxDuration, mediaMaxDuration, imageChoices, imagesCountPerRow, audioPlayerType, silenceCheck, shuffleImages, ratingSliderOn, statementQueBtnText, lowerBoundLevel, upperBoundLevel, lowerBoundNumber, upperBoundNumber, sliderIncrement and makeAudioOptional. NPS Question forces ratingScale to 10. To insert between questions, send isBetweenAdded: true and numeric isBetweenAddedOrder. Retrieve an existing builder question as the starting point for complex types; creation accepts the fields listed here rather than every stored question field.

Example request

curl --request POST 'https://www.rapidoform.com/be/api/question' \
  --header "X-EMAIL: $RAPIDOFORM_EMAIL" \
  --header "X-API-KEY: $RAPIDOFORM_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{"surveyId":"12345","questionOrder":1,"questionText":"How can we improve?","questionType":"Text Question"}'

JSON request body

{
  "surveyId": "12345",
  "questionOrder": 1,
  "questionText": "How can we improve?",
  "questionType": "Text Question"
}

Response

Examples show selected fields, not every stored property. Empty arrays are valid for list/report endpoints.

{
  "Errors": [],
  "Info": [],
  "Data": [
    {
      "question": {
        "_id": "000000000000000000000001",
        "surveyId": "12345",
        "questionOrder": 1,
        "questionText": "How can we improve?",
        "questionType": "Text Question"
      },
      "surveyQuestions": [
        {
          "_id": "000000000000000000000001",
          "surveyId": "12345",
          "questionOrder": 1,
          "questionText": "How can we improve?",
          "questionType": "Text Question"
        }
      ]
    }
  ],
  "ErrorCode": "SUCCESS",
  "fieldErrors": {
    "List": []
  }
}

HTTP 200 alone does not indicate success. Check ErrorCode and Errors; see troubleshooting.