Create a question for a section
Headers
-
Content-Type string
-
Accept string
-
X-PLANNR-ACCOUNT-UUID string
Body Required
-
The type of the question
-
Whether the question is required or not
-
The title of the question
-
help_text string
Input placeholder
-
The position of the question in the section.
-
The selection options for the question IF the question is of type selection.
-
The uuid of the section to move the question to.
-
target_field string
The field to update if the question is filled in
-
linked_question_field string
Create a question from a linked field, with this, the type and selection options can be ignored
-
linked_primary boolean
If this is a contact detail or address field, should it be made primary?
POST
/api/v1/form/{form_uuid}/question
curl \
-X POST https://api.plannrcrm.com/api/v1/form/form_uuid/question \
-H "Authorization: Bearer {OAUTH_ACCESS_TOKEN or PERSONAL_ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-PLANNR-ACCOUNT-UUID: {YOUR_PLANNR_ACCOUNT_UUID}" \
-d '{"type":"string","required":"true","title":"What is your name?","help_text":"Gareth","caption":"Enter your full legal name","position":0,"selection_options":["apple","orange"],"section_uuid":"52ea2ae7-6388-4541-9bcc-78996d8a7b0b","target_field":"client.first_name","linked_question_field":"first_name","linked_primary":false}'
Request examples
# Headers
Authorization: Bearer {OAUTH_ACCESS_TOKEN or PERSONAL_ACCESS_TOKEN}
Content-Type: application/json
Accept: application/json
X-PLANNR-ACCOUNT-UUID: {YOUR_PLANNR_ACCOUNT_UUID}
# Payload
{
"type": "string",
"required": "true",
"title": "What is your name?",
"help_text": "Gareth",
"caption": "Enter your full legal name",
"position": 0,
"selection_options": [
"apple",
"orange"
],
"section_uuid": "52ea2ae7-6388-4541-9bcc-78996d8a7b0b",
"target_field": "client.first_name",
"linked_question_field": "first_name",
"linked_primary": false
}
Response examples (200)
{
"key": "what_is_your_name",
"type": "string",
"uuid": "1278f545-ee69-468b-9242-2749bd708bf7",
"title": "What is your name?",
"caption": "Your full legal name",
"section": {
"form": "App\\Http\\Resources\\FormResource",
"uuid": "6189d548-fd61-476b-8793-5da51b10eab8",
"title": "Personal Details",
"position": 1,
"questions": "App\\Http\\Resources\\FormQuestionResource",
"created_at": "2025-01-17T11:18:30+00:00",
"updated_at": "2025-01-17T11:18:30+00:00"
},
"position": 1,
"required": true,
"help_text": "Gareth",
"created_at": "2025-01-17T11:18:30+00:00",
"updated_at": "2025-01-17T11:18:30+00:00",
"target_field": "name",
"linked_primary": true,
"linked_question": {
"type": "selection",
"field": "gender",
"label": "Gender",
"caption": "Your drink preference",
"forced_required": false,
"formatted_field": "Gender",
"is_custom_field": false,
"selection_options": [
"male",
"female",
"non-binary",
"transgender",
"intersex",
"other",
"unknown"
]
},
"selection_options": [
"option 1",
"option 2"
]
}