Add form field
Add a field to a form in the Form Editor.
POST https://cotlet.dev/api/v1/123formbuilder/forms/{form_id}/field
write Confirm
Adds one field by the name it has in the Fields panel (Essentials, Contact details, Date & Time and the other groups). With after_field it is placed below that field, like a field added while another is selected; without it, at the end. A form embedded with the JavaScript code shows the new field as soon as it is saved. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| form_id integer required | integer | Form id from list_forms. |
| field_type string required | string | Field type as named in the Fields panel, e.g. Email. |
| label string required | string | Label shown above the field. |
| after_field string | string | Label of the field it goes below. |
Request
curl -X POST https://cotlet.dev/api/v1/123formbuilder/forms/5130021/field \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"field_type":"Email","label":"Work email","after_field":"Email"}' result = client.call("123formbuilder", "add_form_field", {"form_id":5130021,"field_type":"Email","label":"Work email","after_field":"Email"}) const result = await cotlet.call('123formbuilder', 'add_form_field', {"form_id":5130021,"field_type":"Email","label":"Work email","after_field":"Email"}); cotlet call 123formbuilder add_form_field --data '{"form_id":5130021,"field_type":"Email","label":"Work email","after_field":"Email"}' Example response
{
"form_id": 5130021,
"field": {
"label": "Work email",
"type": "Email",
"required": false
},
"position": 3
}