Question Commands¶
The canviq question commands manage questions within a survey. All operations require the surveys:write scope on your API key and authentication (see Authentication). Every subcommand also accepts the global --json/--quiet flags; see Scripting and CI.
Valid question types: multiple_choice, rating, free_text, yes_no, matrix, ranking, image_selection, file_upload.
question create <survey-id>¶
Add a question to a survey.
canviq question create srv_abc123 \
--text "How disappointed would you be if you could no longer use this product?" \
--type multiple_choice
canviq question create srv_abc123 \
--text "What type of person benefits most from this product?" \
--type free_text \
--position 1 \
--json
Options
| Flag | Required | Description |
|---|---|---|
--text <text> | yes | Question text |
--type <type> | yes | Question type: multiple_choice, rating, free_text, yes_no, matrix, ranking, image_selection, file_upload |
--position <n> | no | 1-based position (1 = first question); omit to append at the end |
--json | no | Output raw JSON |
--quiet | no | Suppress output except errors |
--position 1 places the question first, --position 2 places it second, and so on. The CLI converts this to the 0-based sort_order value used internally before sending it to the server.
question update <question-id>¶
Update an existing question's text, type, or config. At least one of --text, --type, or --config is required.
canviq question update q_xyz789 --text "Updated question text"
canviq question update q_xyz789 --type rating --json
canviq question update q_xyz789 \
--config '{"choices":["Very disappointed","Somewhat disappointed","Not disappointed"]}'
Options
| Flag | Description |
|---|---|
--text <text> | New question text |
--type <type> | New question type: multiple_choice, rating, free_text, yes_no, matrix, ranking, image_selection, file_upload |
--config <json> | Config JSON (for example, choices for a multiple_choice question) |
--json | Output raw JSON |
--quiet | Suppress output except errors |
question delete <question-id>¶
Delete a question. This is permanent and cannot be undone. The CLI prompts for confirmation unless --yes is passed.
canviq question delete q_xyz789
# Delete question q_xyz789? This is permanent and cannot be undone. [y/N]
canviq question delete q_xyz789 --yes
canviq question delete q_xyz789 --yes --quiet
Options
| Flag | Description |
|---|---|
--yes | Skip the confirmation prompt |
--json | Output raw JSON |
--quiet | Suppress output except errors |
!!! warning Pass --yes in CI or scripts to avoid the confirmation prompt hanging the process. In non-TTY environments, the prompt will block indefinitely without it.
question reorder <survey-id>¶
Set a new order for all questions in a survey. Pass every question ID in the desired order as a comma-separated list.
canviq question reorder srv_abc123 \
--order q_first,q_second,q_third
canviq question reorder srv_abc123 \
--order q_first,q_second,q_third \
--json
Options
| Flag | Required | Description |
|---|---|---|
--order <ids> | yes | Comma-separated question IDs in the new order |
--json | no | Output raw JSON |
--quiet | no | Suppress output except errors |
The --order list must contain at least one question ID. The list replaces the current order entirely, so include every question that should remain in the survey.