Create Form
curl --request POST \
--url https://geniusforms.ai/api/v1/forms \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"title": "Customer Feedback"
}
'import requests
url = "https://geniusforms.ai/api/v1/forms"
payload = { "title": "Customer Feedback" }
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({title: 'Customer Feedback'})
};
fetch('https://geniusforms.ai/api/v1/forms', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": 208,
"title": "Customer Feedback",
"description": "Help us improve our service",
"isPublished": false,
"shareUrl": "abc123xyz",
"url": "https://geniusforms.ai/f/abc123xyz",
"displayMode": "single-page",
"createdAt": "2023-11-07T05:31:56Z",
"publishedAt": "2023-11-07T05:31:56Z",
"webhook": {
"enabled": false,
"url": "https://example.com/webhook"
},
"questions": [
{
"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": {}
}
]
}
}
}
]
}{
"error": "validation_error",
"message": "Invalid request"
}Forms
Create Form
Create a new form with optional questions.
POST
/
forms
Create Form
curl --request POST \
--url https://geniusforms.ai/api/v1/forms \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"title": "Customer Feedback"
}
'import requests
url = "https://geniusforms.ai/api/v1/forms"
payload = { "title": "Customer Feedback" }
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({title: 'Customer Feedback'})
};
fetch('https://geniusforms.ai/api/v1/forms', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": 208,
"title": "Customer Feedback",
"description": "Help us improve our service",
"isPublished": false,
"shareUrl": "abc123xyz",
"url": "https://geniusforms.ai/f/abc123xyz",
"displayMode": "single-page",
"createdAt": "2023-11-07T05:31:56Z",
"publishedAt": "2023-11-07T05:31:56Z",
"webhook": {
"enabled": false,
"url": "https://example.com/webhook"
},
"questions": [
{
"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": {}
}
]
}
}
}
]
}{
"error": "validation_error",
"message": "Invalid request"
}Authorizations
API key obtained from your GeniusForms dashboard
Body
application/json
Response
Form created
Example:
208
Example:
"Customer Feedback"
Example:
"Help us improve our service"
Example:
false
Example:
"abc123xyz"
Example:
"https://geniusforms.ai/f/abc123xyz"
Available options:
single-page, multi-step Example:
"single-page"
Webhook configuration for the form
Show child attributes
Show child attributes
Show child attributes
Show child attributes