Add Question
curl --request POST \
--url https://geniusforms.ai/api/v1/forms/{id}/fields \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"question": "<string>"
}
'import requests
url = "https://geniusforms.ai/api/v1/forms/{id}/fields"
payload = { "question": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({question: '<string>'})
};
fetch('https://geniusforms.ai/api/v1/forms/{id}/fields', 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
Add Question
Add a new question to a form.
POST
/
forms
/
{id}
/
fields
Add Question
curl --request POST \
--url https://geniusforms.ai/api/v1/forms/{id}/fields \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"question": "<string>"
}
'import requests
url = "https://geniusforms.ai/api/v1/forms/{id}/fields"
payload = { "question": "<string>" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({question: '<string>'})
};
fetch('https://geniusforms.ai/api/v1/forms/{id}/fields', 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
Path Parameters
Form ID
Body
application/json
Available options:
text, textarea, email, number, phone, url, date, time, select, multi_select, rating, slider, yes_no, file_upload, currency Required string length:
1 - 1000Required for select/multi_select types
Conditional logic for showing/hiding questions
Show child attributes
Show child attributes
Required for slider type
Show child attributes
Show child attributes
Response
201 - application/json
Question created
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