Create a form
Headers
-
Content-Type string
-
Accept string
-
X-PLANNR-ACCOUNT-UUID string
Body Required
-
The title of the form
-
description string
The description of the form
-
visibility string
The visibility of the form. Available options: public, private, hidden and internal
-
allowed_hosts array[string]
Domain hosts to allow viewing this form when embedded
-
create_client boolean
Should this form create a new client if a submission comes form no registered account
-
client_type string
Required if create client is true, the type of client to create on form submission, available values are: client and prospect
POST /api/v1/form
curl \
-X POST https://api.plannrcrm.com/api/v1/form \
-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 '{"title":"Annual Survey Form","description":"This is the annual survey form for 2022","visibility":"public","allowed_hosts":["example.com","example.org"],"create_client":false,"client_type":"client"}'
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
{
"title": "Annual Survey Form",
"description": "This is the annual survey form for 2022",
"visibility": "public",
"allowed_hosts": [
"example.com",
"example.org"
],
"create_client": false,
"client_type": "client"
}
Response examples (201)
{
"live": true,
"uuid": "bf8d772d-699b-413d-9c19-c5c95281f409",
"title": "Annual Catchup 2022",
"sections": {
"key": "what_is_your_name",
"type": "string",
"uuid": "97474304-e733-4a15-b1ac-1e360eb96367",
"title": "What is your name?",
"caption": "Your full legal name",
"section": "App\\Http\\Resources\\FormSectionResource",
"position": 1,
"required": true,
"help_text": "Gareth",
"created_at": "2024-11-20T13:24:01+00:00",
"updated_at": "2024-11-20T13:24:01+00:00",
"target_field": "name",
"linked_primary": true,
"linked_question": "App\\Http\\Resources\\FormBuilder\\LinkedFormQuestionResource",
"selection_options": [
"option 1",
"option 2"
]
},
"created_at": "2024-11-20T13:24:01+00:00",
"updated_at": "2024-11-20T13:24:01+00:00",
"visibility": "public",
"client_type": "client",
"description": "This is the annual catchup form for 2022",
"allowed_hosts": [
"domain.com",
"subdomain.domain.com"
],
"create_client": true,
"draft_submissions_count": 5,
"submitted_submissions_count": 5
}