Questions & Pages API

Manage survey structure — pages, questions, options, and ordering.

Questions & Pages API

Surveys are organized into pages, each containing questions. Questions can have options (for choice-type questions) and support conditional logic.

Pages

List Pages

GET /api/surveys/:surveyId/pages

Create Page

POST /api/surveys/:surveyId/pages
Field Type Required Description
page_title string No Page title/heading
page_description string No Page description

Update Page

PUT /api/surveys/:surveyId/pages/:pageId

Delete Page

DELETE /api/surveys/:surveyId/pages/:pageId

Reorder Pages

PUT /api/surveys/:surveyId/pages/reorder

Body: { "page_ids": [3, 1, 2] } — array of page IDs in desired order.


Questions

List Questions

GET /api/surveys/:surveyId/questions

Returns all questions across all pages with their options and settings.

Create Question

POST /api/surveys/:surveyId/questions
Field Type Required Description
page_id integer Yes Page to add the question to
question_type string Yes Question type (see table below)
question_text string Yes Question text/label
question_code string No Variable code for data export
question_required boolean No Whether response is required
question_settings object No Type-specific settings
options array No Answer options for choice questions

Example:

curl -X POST \
  -H "X-API-Key: tp_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "page_id": 1,
    "question_type": "single_choice",
    "question_text": "How satisfied are you with our service?",
    "question_required": true,
    "options": [
      {"option_label": "Very satisfied", "option_value": "5"},
      {"option_label": "Satisfied", "option_value": "4"},
      {"option_label": "Neutral", "option_value": "3"},
      {"option_label": "Dissatisfied", "option_value": "2"},
      {"option_label": "Very dissatisfied", "option_value": "1"}
    ]
  }' \
  https://tabularpro.com/api/surveys/1/questions

Update Question

PUT /api/surveys/:surveyId/questions/:questionId

Delete Question

DELETE /api/surveys/:surveyId/questions/:questionId

Reorder Questions

PUT /api/surveys/:surveyId/questions/reorder

Body: { "question_ids": [5, 3, 1, 2, 4] }

Question Types

Type Description Has Options
single_choice Radio buttons — one selection Yes
multiple_choice Checkboxes — multiple selections Yes
text Open-ended text input No
number Numeric input No
scale Linear scale (e.g., 1-10) No
matrix Grid/matrix with rows and columns Yes
ranking Drag-and-drop ranking Yes
date Date picker No
nps Net Promoter Score (0-10) No
dropdown Dropdown select Yes
slider Visual slider No
file_upload File attachment No

Option Object

For choice-type questions, each option has:

Field Type Description
option_label string Display text
option_value string Data value (defaults to label)
option_order integer Sort position
option_image string Optional image URL