Add question

Add one question of any field type to a form.

POST https://cotlet.dev/api/v1/fillout/forms/{form_id}/questions

write

Adds a question to a page of a form and returns its ID. Use it for fields that need more than a label, such as a signature, a file upload or a rating. Choice types take options. The change reaches respondents only after publish_form. This call is undone by update_question or by restoring an earlier version from the editor's edit history, so it runs without asking first.

Parameters

Parameters: add_question
NameTypeDescription
form_id string required string Form ID from list_forms.
label string required string The question text.
type enum required enum Field type: Address, AudioRecording, Calcom, Calendly, Captcha, Checkbox, Checkboxes, ColorPicker, CurrencyInput, DatePicker, DateRange, DateTimePicker, Dropdown, EmailInput, FileUpload, ImagePicker, LocationCoordinates, LongAnswer, Matrix, MultiSelect, MultipleChoice, NumberInput, OpinionScale, Password, Payment, PhoneNumber, Ranking, RecordPicker, ShortAnswer, Signature, Slider, StarRating, Subform, SubmissionPicker, Switch, Table, TimePicker or URLInput.
options array array Answer options, for Dropdown, MultipleChoice, Checkboxes and similar types.
required boolean boolean Make the question required. Default: false.
page string string Name of the form page to add it to. Default: the last form page.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/fillout/forms/form_8c41d2/questions \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label":"label","type":"Field type: Address"}'
Python
result = client.call("fillout", "add_question", {"form_id":"form_8c41d2","label":"label","type":"Field type: Address"})
Node.js
const result = await cotlet.call('fillout', 'add_question', {"form_id":"form_8c41d2","label":"label","type":"Field type: Address"});
CLI
cotlet call fillout add_question --data '{"form_id":"form_8c41d2","label":"label","type":"Field type: Address"}'

Example response

JSON

{
  "form_id": "fpj3Kd9xQw2L",
  "question": {
    "id": "q_rating",
    "name": "How was the session?",
    "type": "StarRating",
    "required": false
  }
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.