Update a Question
Updates a Question and its options.
curl --request PATCH \
--url https://api.sprig.com/v2/studies/{studyId}/questions/{questionId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'If-Match: <if-match>' \
--data '
{
"configuration": {
"tasksPerRespondent": 10
}
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": {
"html": "<string>",
"variables": {}
},
"required": true,
"displayLogic": {
"source": {
"type": "QUESTION_RESPONSE",
"question": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
},
"operator": "EQUALS",
"value": "<string>"
},
"skipLogic": [
{
"when": {
"source": {
"type": "QUESTION_RESPONSE",
"question": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
},
"operator": "EQUALS",
"value": "<string>"
},
"destination": {
"type": "END"
}
}
],
"aiFollowUp": {
"userPrompt": "<string>"
},
"randomizePosition": true,
"type": "OPEN_TEXT",
"name": "<string>",
"description": {
"html": "<string>",
"variables": {}
},
"image": {
"url": "<string>",
"altText": "<string>",
"displaySize": "FIT",
"alignment": "LEFT",
"width": 123,
"height": 123,
"mediaType": "image/gif",
"originalFilename": "<string>",
"assetId": "<string>"
},
"responsePlaceholder": "<string>"
}{
"code": "<string>",
"message": "<string>",
"errors": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"resource": {
"type": "<string>",
"id": "<string>"
}
}
]
}{
"code": "<string>",
"message": "<string>",
"errors": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"resource": {
"type": "<string>",
"id": "<string>"
}
}
]
}{
"code": "<string>",
"message": "<string>",
"errors": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"resource": {
"type": "<string>",
"id": "<string>"
}
}
]
}{
"code": "<string>",
"message": "<string>",
"errors": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"resource": {
"type": "<string>",
"id": "<string>"
}
}
]
}{
"code": "<string>",
"message": "<string>",
"errors": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"resource": {
"type": "<string>",
"id": "<string>"
}
}
]
}{
"code": "<string>",
"message": "<string>",
"errors": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"resource": {
"type": "<string>",
"id": "<string>"
}
}
]
}Authorizations
Use API-Key YOUR_API_KEY. The key selects the Production or Development environment.
Headers
Quoted Study version last read from ETag or Study.version. Required on mutating Study writes.
"\"126300\""
Query Parameters
true, false Body
A partial Question update. Omitted fields retain their stored values.
A new unique name, or null to remove the existing name.
1 - 128The authored title accepted when creating a Question.
Show child attributes
Show child attributes
Optional respondent-facing description shown with a Question.
Show child attributes
Show child attributes
Whether this Question participates in layout-position randomization. Defaults to false.
Repositions the Question. Submit this field by itself or with blockId.
Show child attributes
Show child attributes
Public UUID of the Block that will contain this Question, or null to move it to the Study root. Submit this field by itself or with position.
Show child attributes
Show child attributes
The public Question type.
OPEN_TEXT, SINGLE_SELECT, MULTIPLE_SELECT, RATING_SCALE, NPS, VALIDATED_TEXT, RANK_ORDER, MATRIX, TEXT_URL_PROMPT, CONSENT_LEGAL, AI_DYNAMIC, CONJOINT, MAX_DIFF Carries respondent-selected items from an earlier Question.
Show child attributes
Show child attributes
LIST, DROPDOWN One ordered item to rank. Its value is immutable; its label may be updated.
- Rank order options · object[]
- Options · object[]
- Matrix rows · object[]
Show child attributes
Show child attributes
Inclusive minimum and maximum number of Options a respondent may select.
Show child attributes
Show child attributes
Number of points on the rating scale.
3 How the rating-scale points are displayed.
NUMBER, STAR, SMILEY Optional label shown at one endpoint of the scale.
255Optional label shown at one endpoint of the scale.
255The validation rule applied to a validated-text response.
- Email
- URL
- Regular expression
- Number
- Phone
Show child attributes
Show child attributes
Placeholder shown in the response field.
Error shown when the response does not satisfy validation.
1 - 200Optional respondent-facing footer shown below the response field.
Show child attributes
Show child attributes
1 - 2551 - 2552Show child attributes
Show child attributes
2Show child attributes
Show child attributes
Total number of authored choices shown to each respondent, including pinned choices.
x >= 2Button behavior for a Text/URL Prompt.
- Continue
- External link
- No button
Show child attributes
Show child attributes
1 - 2551 - 2551 - 255- Recommended MaxDiff configuration
- Custom MaxDiff configuration
- Conjoint configuration
Show child attributes
Show child attributes
How respondents mark the best and worst item in each set.
RADIO, SMILEY 1 - 2551 - 255Opaque id of a CONSENT_DOCUMENT asset owned by this environment.
^[A-Za-z0-9_-]{1,128}$3 - 8 elementsShow child attributes
Show child attributes
Show child attributes
Show child attributes
Attaches a QUESTION_IMAGE recorded on this Study. Null removes the current image. Omission leaves it unchanged.
Show child attributes
Show child attributes
Replaces Question-owned display logic. Null clears it. Omission preserves the stored value.
- Condition
- All of
- Any of
Show child attributes
Show child attributes
Replaces Question skip logic. Null or an empty array clears it. Omission preserves the stored value.
20Show child attributes
Show child attributes
Response
OK
- Open text
- AI dynamic
- Single select
- Multiple select
- Rating scale
- NPS
- Validated text
- Rank order
- Matrix
- MaxDiff
- Text / URL prompt
- Consent / legal
- Conjoint
- File upload
Canonical Question resource.
Canonical rich-text Question title.
Show child attributes
Show child attributes
A single typed condition. Operators that inspect answer state omit value; choice comparisons use immutable Option values.
- Condition
- All of
- Any of
Show child attributes
Show child attributes
Ordered skip rules, limited to 20. An empty array clears skip logic.
20Show child attributes
Show child attributes
Show child attributes
Show child attributes
OPEN_TEXT Canonical respondent-facing Question description.
Show child attributes
Show child attributes
The image shown with a Question. Omitted when the Question has no image.
Show child attributes
Show child attributes
Placeholder shown in the response field.
Was this page helpful?
curl --request PATCH \
--url https://api.sprig.com/v2/studies/{studyId}/questions/{questionId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'If-Match: <if-match>' \
--data '
{
"configuration": {
"tasksPerRespondent": 10
}
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": {
"html": "<string>",
"variables": {}
},
"required": true,
"displayLogic": {
"source": {
"type": "QUESTION_RESPONSE",
"question": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
},
"operator": "EQUALS",
"value": "<string>"
},
"skipLogic": [
{
"when": {
"source": {
"type": "QUESTION_RESPONSE",
"question": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
},
"operator": "EQUALS",
"value": "<string>"
},
"destination": {
"type": "END"
}
}
],
"aiFollowUp": {
"userPrompt": "<string>"
},
"randomizePosition": true,
"type": "OPEN_TEXT",
"name": "<string>",
"description": {
"html": "<string>",
"variables": {}
},
"image": {
"url": "<string>",
"altText": "<string>",
"displaySize": "FIT",
"alignment": "LEFT",
"width": 123,
"height": 123,
"mediaType": "image/gif",
"originalFilename": "<string>",
"assetId": "<string>"
},
"responsePlaceholder": "<string>"
}{
"code": "<string>",
"message": "<string>",
"errors": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"resource": {
"type": "<string>",
"id": "<string>"
}
}
]
}{
"code": "<string>",
"message": "<string>",
"errors": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"resource": {
"type": "<string>",
"id": "<string>"
}
}
]
}{
"code": "<string>",
"message": "<string>",
"errors": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"resource": {
"type": "<string>",
"id": "<string>"
}
}
]
}{
"code": "<string>",
"message": "<string>",
"errors": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"resource": {
"type": "<string>",
"id": "<string>"
}
}
]
}{
"code": "<string>",
"message": "<string>",
"errors": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"resource": {
"type": "<string>",
"id": "<string>"
}
}
]
}{
"code": "<string>",
"message": "<string>",
"errors": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"resource": {
"type": "<string>",
"id": "<string>"
}
}
]
}