Create survey question

Create Survey Question

Creates a new question on a specified page of a survey. Supports all Alchemer question types and a wide range of configuration properties.

Endpoint

PUT v5/survey/{survey_id}/surveypage/{page_id}/surveyquestion

Requires authentication

Path Parameters

Identifies the survey and page on which the question will be created.

survey_id
string
required
The ID of the survey to add the question to.
page_id
string
required
The ID of the survey page to add the question to.

Query Parameters

type
string
The question type to create. Accepted values: radio, checkbox, menu, text, essay, email, multitext, single-image, multi-image, contsum, rank-dragdrop, table-radio, table-checkbox, table-textbox, table-menu-matrix, table-stars, file, instructions, media, audio, video, hidden, urlredirect, group, heatmap, texthighlighter, httpinsert, javascript.
title
string
The question text.
description
string
Description or sub-text for the question.
after
string
The ID of the question this new question should follow. Used to control placement on the page.
shortname
string
A shortname or alias for the question.
varname
string
The SPSS variable name for the question. For question types with multiple fields (e.g. Textbox List), specify as an array keyed by option ID — for example, varname[10001]=Comedy&varname[10002]=Drama.
id
string
The question ID of the parent question. Required when adding sub-questions (rows) to grid question types: table-radio, table-checkbox, table-textbox, table-menu-matrix, table-stars, and group. Use multitext to create rows of a Dropdown Menu Grid.
properties
object
Configuration properties for the question. All properties keys are passed as individual query parameters using bracket notation — for example, properties[required]=true.

Response

Returns the result of the creation request and the newly created question object.

result_ok
boolean
Whether the request succeeded.
data
object
The newly created survey question object. See Get Survey Question for the full list of response fields.

Examples

Request (cURL)
curl -X PUT "https://api.alchemer.com/v5/survey/123456/surveypage/1/surveyquestion?api_token=YOUR_API_TOKEN&api_token_secret=YOUR_API_TOKEN_SECRET&type=radio&title=How+satisfied+are+you%3F&properties[required]=true&properties[orientation]=VERT"
Response
{
  "result_ok": true,
  "data": {
    "id": 7,
    "type": "radio",
    "title": {
      "English": "How satisfied are you?"
    },
    "description": {
      "English": ""
    },
    "shortname": "",
    "varname": "",
    "has_options": true,
    "options": [],
    "properties": {
      "required": true,
      "hidden": false,
      "orientation": "VERT"
    }
  }
}