curl --request POST \
--url https://{baseurl}/api/v1/management/surveys \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data @- <<EOF
{
"autoClose": null,
"autoComplete": null,
"createdBy": null,
"delay": 0,
"displayLimit": null,
"displayOption": "displayOnce",
"displayPercentage": null,
"endings": [
{
"buttonLabel": {
"default": "Create your own Survey"
},
"buttonLink": "https://formbricks.com/signup",
"headline": {
"default": "Thank you!"
},
"id": "p73t62dgwq0cvmtt6ug0hmfc",
"subheader": {
"default": "We appreciate your feedback."
},
"type": "endScreen"
}
],
"environmentId": "{{environmentId}}",
"hiddenFields": {
"enabled": false,
"fieldIds": []
},
"isVerifyEmailEnabled": false,
"languages": [],
"name": "Example Survey",
"pin": null,
"productOverwrites": null,
"questions": [
{
"headline": {
"default": "What would you like to know?"
},
"id": "ovpy6va1hab7fl12n913zua0",
"inputType": "text",
"placeholder": {
"default": "Type your answer here..."
},
"required": true,
"subheader": {
"default": "This is an example survey."
},
"type": "openText"
},
{
"choices": [
{
"id": "xpoxuu3sifk1ee8he67ctf5i",
"label": {
"default": "Sun ☀️"
}
},
{
"id": "hnsovcdmxtcbly6tig1az3qc",
"label": {
"default": "Ocean 🌊"
}
},
{
"id": "kcnelzdxknvwo8fq20d3nrr5",
"label": {
"default": "Palms 🌴"
}
}
],
"headline": {
"default": "What's important on vacay?"
},
"id": "awkn2llljy7a4oulp5t15yec",
"required": true,
"shuffleOption": "none",
"type": "multipleChoiceMulti"
}
],
"recontactDays": null,
"redirectUrl": null,
"segmentId": null,
"showLanguageSwitch": null,
"singleUse": {
"enabled": false,
"isEncrypted": true
},
"status": "inProgress",
"styling": null,
"surveyClosedMessage": null,
"triggers": [],
"type": "link",
"welcomeCard": {
"enabled": true,
"fileUrl": "",
"headline": {
"default": "Welcome!"
},
"html": {
"default": "<p class=\"fb-editor-paragraph\" dir=\"ltr\"><span style=\"white-space: pre-wrap;\">Thanks for providing your feedback - let's go!</span></p>"
},
"showResponseCount": false,
"timeToFinish": false
}
}
EOF{
"data": {
"autoClose": null,
"autoComplete": null,
"createdAt": "2024-08-05T11:08:27.042Z",
"createdBy": "clfv1zvij0000ru0gunwpy43a",
"delay": 0,
"displayLimit": null,
"displayOption": "displayOnce",
"displayPercentage": null,
"endings": [
{
"buttonLabel": {
"default": "Create your own Survey"
},
"buttonLink": "https://formbricks.com/signup",
"headline": {
"default": "Thank you!"
},
"id": "p73t62dgwq0cvmtt6ug0hmfc",
"subheader": {
"default": "We appreciate your feedback."
},
"type": "endScreen"
}
],
"environmentId": "clygwxsbh01v5aga1sdien2th",
"hiddenFields": {
"enabled": false,
"fieldIds": []
},
"id": "clzgw1k4i0001mny1unf8eggn",
"isVerifyEmailEnabled": false,
"languages": [],
"name": "Example Survey",
"pin": null,
"productOverwrites": null,
"questions": [
{
"headline": {
"default": "What would you like to know?"
},
"id": "ovpy6va1hab7fl12n913zua0",
"inputType": "text",
"placeholder": {
"default": "Type your answer here..."
},
"required": true,
"subheader": {
"default": "This is an example survey."
},
"type": "openText"
},
{
"choices": [
{
"id": "xpoxuu3sifk1ee8he67ctf5i",
"label": {
"default": "Sun ☀️"
}
},
{
"id": "hnsovcdmxtcbly6tig1az3qc",
"label": {
"default": "Ocean 🌊"
}
},
{
"id": "kcnelzdxknvwo8fq20d3nrr5",
"label": {
"default": "Palms 🌴"
}
}
],
"headline": {
"default": "What's important on vacay?"
},
"id": "awkn2llljy7a4oulp5t15yec",
"required": true,
"shuffleOption": "none",
"type": "multipleChoiceMulti"
}
],
"recontactDays": null,
"redirectUrl": null,
"segment": null,
"showLanguageSwitch": null,
"singleUse": {
"enabled": false,
"isEncrypted": true
},
"status": "inProgress",
"styling": null,
"surveyClosedMessage": null,
"triggers": [],
"type": "link",
"updatedAt": "2024-08-05T11:09:21.826Z",
"welcomeCard": {
"enabled": true,
"fileUrl": "",
"headline": {
"default": "Welcome!"
},
"html": {
"default": "<p class=\"fb-editor-paragraph\" dir=\"ltr\"><span style=\"white-space: pre-wrap;\">Thanks for providing your feedback - let's go!</span></p>"
},
"showResponseCount": false,
"timeToFinish": false
}
}
}Create a survey with granular settings, questions, their types, welcomeCard, thankYouCard, languages, etc right from this API. We’d however recommend you to do this via our Formbricks App with the UI for a better visual experience.
curl --request POST \
--url https://{baseurl}/api/v1/management/surveys \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data @- <<EOF
{
"autoClose": null,
"autoComplete": null,
"createdBy": null,
"delay": 0,
"displayLimit": null,
"displayOption": "displayOnce",
"displayPercentage": null,
"endings": [
{
"buttonLabel": {
"default": "Create your own Survey"
},
"buttonLink": "https://formbricks.com/signup",
"headline": {
"default": "Thank you!"
},
"id": "p73t62dgwq0cvmtt6ug0hmfc",
"subheader": {
"default": "We appreciate your feedback."
},
"type": "endScreen"
}
],
"environmentId": "{{environmentId}}",
"hiddenFields": {
"enabled": false,
"fieldIds": []
},
"isVerifyEmailEnabled": false,
"languages": [],
"name": "Example Survey",
"pin": null,
"productOverwrites": null,
"questions": [
{
"headline": {
"default": "What would you like to know?"
},
"id": "ovpy6va1hab7fl12n913zua0",
"inputType": "text",
"placeholder": {
"default": "Type your answer here..."
},
"required": true,
"subheader": {
"default": "This is an example survey."
},
"type": "openText"
},
{
"choices": [
{
"id": "xpoxuu3sifk1ee8he67ctf5i",
"label": {
"default": "Sun ☀️"
}
},
{
"id": "hnsovcdmxtcbly6tig1az3qc",
"label": {
"default": "Ocean 🌊"
}
},
{
"id": "kcnelzdxknvwo8fq20d3nrr5",
"label": {
"default": "Palms 🌴"
}
}
],
"headline": {
"default": "What's important on vacay?"
},
"id": "awkn2llljy7a4oulp5t15yec",
"required": true,
"shuffleOption": "none",
"type": "multipleChoiceMulti"
}
],
"recontactDays": null,
"redirectUrl": null,
"segmentId": null,
"showLanguageSwitch": null,
"singleUse": {
"enabled": false,
"isEncrypted": true
},
"status": "inProgress",
"styling": null,
"surveyClosedMessage": null,
"triggers": [],
"type": "link",
"welcomeCard": {
"enabled": true,
"fileUrl": "",
"headline": {
"default": "Welcome!"
},
"html": {
"default": "<p class=\"fb-editor-paragraph\" dir=\"ltr\"><span style=\"white-space: pre-wrap;\">Thanks for providing your feedback - let's go!</span></p>"
},
"showResponseCount": false,
"timeToFinish": false
}
}
EOF{
"data": {
"autoClose": null,
"autoComplete": null,
"createdAt": "2024-08-05T11:08:27.042Z",
"createdBy": "clfv1zvij0000ru0gunwpy43a",
"delay": 0,
"displayLimit": null,
"displayOption": "displayOnce",
"displayPercentage": null,
"endings": [
{
"buttonLabel": {
"default": "Create your own Survey"
},
"buttonLink": "https://formbricks.com/signup",
"headline": {
"default": "Thank you!"
},
"id": "p73t62dgwq0cvmtt6ug0hmfc",
"subheader": {
"default": "We appreciate your feedback."
},
"type": "endScreen"
}
],
"environmentId": "clygwxsbh01v5aga1sdien2th",
"hiddenFields": {
"enabled": false,
"fieldIds": []
},
"id": "clzgw1k4i0001mny1unf8eggn",
"isVerifyEmailEnabled": false,
"languages": [],
"name": "Example Survey",
"pin": null,
"productOverwrites": null,
"questions": [
{
"headline": {
"default": "What would you like to know?"
},
"id": "ovpy6va1hab7fl12n913zua0",
"inputType": "text",
"placeholder": {
"default": "Type your answer here..."
},
"required": true,
"subheader": {
"default": "This is an example survey."
},
"type": "openText"
},
{
"choices": [
{
"id": "xpoxuu3sifk1ee8he67ctf5i",
"label": {
"default": "Sun ☀️"
}
},
{
"id": "hnsovcdmxtcbly6tig1az3qc",
"label": {
"default": "Ocean 🌊"
}
},
{
"id": "kcnelzdxknvwo8fq20d3nrr5",
"label": {
"default": "Palms 🌴"
}
}
],
"headline": {
"default": "What's important on vacay?"
},
"id": "awkn2llljy7a4oulp5t15yec",
"required": true,
"shuffleOption": "none",
"type": "multipleChoiceMulti"
}
],
"recontactDays": null,
"redirectUrl": null,
"segment": null,
"showLanguageSwitch": null,
"singleUse": {
"enabled": false,
"isEncrypted": true
},
"status": "inProgress",
"styling": null,
"surveyClosedMessage": null,
"triggers": [],
"type": "link",
"updatedAt": "2024-08-05T11:09:21.826Z",
"welcomeCard": {
"enabled": true,
"fileUrl": "",
"headline": {
"default": "Welcome!"
},
"html": {
"default": "<p class=\"fb-editor-paragraph\" dir=\"ltr\"><span style=\"white-space: pre-wrap;\">Thanks for providing your feedback - let's go!</span></p>"
},
"showResponseCount": false,
"timeToFinish": false
}
}
}draft, inProgress, paused, completed link, app displayOnce, displayMultiple, respondMultiple, displaySome Show child attributes
text, email, url, number, phone none, all, exceptLast address, cta, consent, date, fileUpload, matrix, multipleChoiceMulti, multipleChoiceSingle, nps, openText, pictureSelection, rating, cal, ranking, contactInfo OK
The response is of type object.
Was this page helpful?