Update Question
curl --request PATCH \
--url https://geniusforms.ai/api/v1/forms/{id}/fields/{fieldId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"question": "<string>",
"required": true,
"options": [
"<string>"
]
}
'import requests
url = "https://geniusforms.ai/api/v1/forms/{id}/fields/{fieldId}"
payload = {
"question": "<string>",
"required": True,
"options": ["<string>"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({question: '<string>', required: true, options: ['<string>']})
};
fetch('https://geniusforms.ai/api/v1/forms/{id}/fields/{fieldId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": 1,
"order": 1,
"type": "text",
"question": "Your name",
"required": true,
"options": [
"Option A",
"Option B"
],
"conditionalLogic": {
"showIf": {
"questionId": 123,
"operator": "equals",
"value": "<string>"
},
"advanced": {
"conditionGroups": [
{
"id": "<string>",
"operator": "AND",
"conditions": [
{
"id": "<string>",
"questionId": 123,
"operator": "equals",
"value": "<string>",
"valueType": "static"
}
]
}
],
"actions": [
{
"type": "show_question",
"targetId": 123,
"value": "<unknown>"
}
],
"scoreRules": [
{
"id": "<string>",
"questionId": 123,
"scoreMap": {}
}
]
}
}
}Questions
Update Question
Update an existing question.
PATCH
/
forms
/
{id}
/
fields
/
{fieldId}
Update Question
curl --request PATCH \
--url https://geniusforms.ai/api/v1/forms/{id}/fields/{fieldId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"question": "<string>",
"required": true,
"options": [
"<string>"
]
}
'import requests
url = "https://geniusforms.ai/api/v1/forms/{id}/fields/{fieldId}"
payload = {
"question": "<string>",
"required": True,
"options": ["<string>"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({question: '<string>', required: true, options: ['<string>']})
};
fetch('https://geniusforms.ai/api/v1/forms/{id}/fields/{fieldId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": 1,
"order": 1,
"type": "text",
"question": "Your name",
"required": true,
"options": [
"Option A",
"Option B"
],
"conditionalLogic": {
"showIf": {
"questionId": 123,
"operator": "equals",
"value": "<string>"
},
"advanced": {
"conditionGroups": [
{
"id": "<string>",
"operator": "AND",
"conditions": [
{
"id": "<string>",
"questionId": 123,
"operator": "equals",
"value": "<string>",
"valueType": "static"
}
]
}
],
"actions": [
{
"type": "show_question",
"targetId": 123,
"value": "<unknown>"
}
],
"scoreRules": [
{
"id": "<string>",
"questionId": 123,
"scoreMap": {}
}
]
}
}
}Authorizations
API key obtained from your GeniusForms dashboard
Response
200 - application/json
Question updated
Example:
1
Example:
1
Available options:
text, textarea, email, number, phone, url, date, time, select, multi_select, rating, slider, yes_no, file_upload, currency Example:
"text"
Example:
"Your name"
Example:
true
Example:
["Option A", "Option B"]
Conditional logic for showing/hiding questions
Show child attributes
Show child attributes