API Reference - Forms

Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108075

← Back to API Reference | Getting Started

Forms

Forms define the structure and configuration of data-entry forms used throughout your directory website. Each form record specifies the target database table, email notification settings, layout, and other rendering options. Form fields are managed separately via the Form Fields endpoint.

Model name in URL: form — DB table: forms

The Forms Object

FieldTypeDescription
form_idintegerUnique form ID (primary key, read-only)
form_namestringInternal machine name for the form (used to reference it in widgets and code)
form_desctextOptional description of the form's purpose
form_urltextURL to redirect to after form submission
form_targetstringRedirect target (EG _blank to open in a new tab)
form_actionstringHTTP method used to submit the form (EG post)
form_databasestringDatabase identifier the form writes to (blank for the default site database)
form_tablestringDatabase table the form writes to (EG users_data, data_posts)
table_indexstringPrimary key column of the target table used to identify the record being updated
form_email_recipientstringEmail address to receive form submission notifications
form_titlestringHuman-readable title displayed in the admin panel
form_email_onintegerWhether to send email notifications on submission: 1 = enabled, 0 = disabled
email_templatestringEmail template name sent to the member/submitter
email_adminintegerWhether to also send notification email to the admin: 1 = yes, 0 = no
email_fromstringFrom email address used in notification emails
email_template_adminstringEmail template name sent to the admin
form_classstringCSS class(es) applied to the form element (EG form-control)
form_styletextInline CSS styles applied to the form element
form_element_idstringHTML id attribute applied to the form element
short_codestringShort code used to embed the form in content areas
form_layoutstringLayout framework for the form (EG bootstrap)
trigger_data_flowstringWhether to trigger a data flow automation on submission (EG No, Yes)
data_flow_namestringName of the data flow automation to trigger on submission
revision_timestamptimestampDate and time the form was last modified
form_action_typestringHow the form processes its action after submission (EG default)
form_action_divstringID of the HTML element to update or target after submission
label_to_placeholderstringVirtual field controlling label-to-placeholder conversion
return_data_typestringVirtual field specifying form return data type
form_fields_namestringVirtual field for form field name reference
old_form_namestringVirtual field storing previous form name
disablestringVirtual field controlling form disabled state

List Forms Records

GET /api/v2/form/get

Returns a paginated list of form records.

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/form/get?limit=25" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "tablesExists": true,
      "form_id": "313",
      "form_name": "member_listing_details",
      "form_desc": "",
      "form_url": "",
      "form_target": "",
      "form_action": "post",
      "form_database": "",
      "form_table": "users_data",
      "table_index": "user_id",
      "form_email_recipient": "",
      "form_title": "Listing - Additional Details - Member",
      "form_email_on": "0",
      "email_template": "",
      "email_admin": "0",
      "email_from": "",
      "email_template_admin": "",
      "form_class": "form-control",
      "form_style": "",
      "form_element_id": "",
      "short_code": "",
      "form_layout": "bootstrap",
      "trigger_data_flow": "No",
      "data_flow_name": "",
      "revision_timestamp": "2025-01-06 14:06:48",
      "form_action_type": "default",
      "form_action_div": ""
    }
  ],
  "total": "9",
  "current_page": 1,
  "total_pages": 1
}

Retrieve a Form

GET /api/v2/form/get/{form_id}

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/form/get/313" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "tablesExists": true,
      "form_id": "313",
      "form_name": "member_listing_details",
      "form_desc": "",
      "form_url": "",
      "form_target": "",
      "form_action": "post",
      "form_database": "",
      "form_table": "users_data",
      "table_index": "user_id",
      "form_email_recipient": "",
      "form_title": "Listing - Additional Details - Member",
      "form_email_on": "0",
      "email_template": "",
      "email_admin": "0",
      "email_from": "",
      "email_template_admin": "",
      "form_class": "form-control",
      "form_style": "",
      "form_element_id": "",
      "short_code": "",
      "form_layout": "bootstrap",
      "trigger_data_flow": "No",
      "data_flow_name": "",
      "revision_timestamp": "2025-01-06 14:06:48",
      "form_action_type": "default",
      "form_action_div": ""
    }
  ],
  "total": "1",
  "current_page": 1,
  "total_pages": 1
}

Create a Form

POST /api/v2/form/create

Example Request

Copy
curl -X POST "https://www.yourdomain.com/api/v2/form/create" \
  -H "X-Api-Key: your-api-key-here" \
  -d "form_name=contact_form" \
  -d "form_title=Contact+Us+Form" \
  -d "form_action=post" \
  -d "form_layout=bootstrap" \
  -d "form_class=form-control" \
  -d "form_table=form_inquiries" \
  -d "form_email_on=1" \
  -d "form_email_recipient=admin%40yourdomain.com"

Example Response

Copy
{
  "status": "success",
  "message": {
    "form_id": "351",
    "form_name": "contact_form",
    "form_desc": null,
    "form_url": null,
    "form_target": null,
    "form_action": "post",
    "form_database": null,
    "form_table": "form_inquiries",
    "table_index": null,
    "form_email_recipient": "admin@yourdomain.com",
    "form_title": "Contact Us Form",
    "form_email_on": "1",
    "email_template": null,
    "email_admin": null,
    "email_from": null,
    "email_template_admin": null,
    "form_class": "form-control",
    "form_style": null,
    "form_element_id": null,
    "short_code": null,
    "form_layout": "bootstrap",
    "trigger_data_flow": null,
    "data_flow_name": null,
    "revision_timestamp": null,
    "form_action_type": null,
    "form_action_div": null
  }
}

Update a Form

PUT /api/v2/form/update

Example Request

Copy
curl -X PUT "https://www.yourdomain.com/api/v2/form/update" \
  -H "X-Api-Key: your-api-key-here" \
  -d "form_id=351" \
  -d "form_title=Contact+Us+Updated" \
  -d "form_email_on=0"

Example Response

Copy
{
  "status": "success",
  "message": {
    "form_id": "351",
    "form_name": "contact_form",
    "form_desc": "",
    "form_url": "",
    "form_target": "",
    "form_action": "post",
    "form_database": "",
    "form_table": "form_inquiries",
    "table_index": "",
    "form_email_recipient": "admin@yourdomain.com",
    "form_title": "Contact Us Updated",
    "form_email_on": "0",
    "email_template": "",
    "email_admin": "0",
    "email_from": "",
    "email_template_admin": "",
    "form_class": "form-control",
    "form_style": "",
    "form_element_id": "",
    "short_code": "",
    "form_layout": "bootstrap",
    "trigger_data_flow": "",
    "data_flow_name": "",
    "revision_timestamp": "2026-04-03 23:47:39",
    "form_action_type": "",
    "form_action_div": ""
  }
}

Delete a Form

DELETE /api/v2/form/delete

Example Request

Copy
curl -X DELETE "https://www.yourdomain.com/api/v2/form/delete" \
  -H "X-Api-Key: your-api-key-here" \
  -d "form_id=351"

Example Response

Copy
{
  "status": "success",
  "message": "form record was deleted"
}