BoldSales

API Documentation

Create a company field

post/api/v1/companies/fields

This API is used to create a new field for a company module. The created field will be used when adding a new company record in the BoldSales application.

Code snippet

curl -X 'POST' \
  'https://{yourdomain}/api/v1/companies/fields' \
  -H 'accept: text/plain; x-api-version=1.0' \
  -H 'x-api-key: {your API key}' \
  -H 'Content-Type: application/json-patch+json; x-api-version=1.0' \
  -d '{
    "data": {
      "fieldName": "Country",
      "fieldTypeId": 1,
      "apiName": "cf_country",
      "description": "Description text for Custom Field",
      "instructions": "Instruction text for Custom Field",
      "placeholderText": "Custom Field Placeholder",
      "isRequired": true,
      "showInCreateForm": true,
      "options": [
        "India",
        "USA"
      ]
    }
  }'

Request body

fieldNamestringRequiredThe internal name of the field used for identification and reference within the system.
fieldTypeIdintegerRequiredRepresents the ID that specifies the type of field. Defines what kind of data can be stored in the field (e.g., text, number).
apiNamestringRequiredThe key used to reference the field in API calls. It must begin with the prefix cf_. For example, cf_lead_source.
descriptionstringDescribes the field's purpose in more detail, often used for instructional or contextual information to help users understand how to use the field.
instructionsstringProvides specific instructions or guidelines on how to correctly fill out the field.
placeholderTextstringText displayed inside the field when it is empty, guiding users on the expected input or providing examples.
isRequiredbooleanBoolean flag indicating whether this field must have a value before the form can be submitted.
showInCreateFormbooleanThis parameter determines the field's visibility on the form page used for record creation. If set to true, the field will be displayed on the form page. If set to false, the field will not appear on the form page.
optionsarraySpecifies the list of available options for dropdown, multi-select dropdown, checkbox list, and radio button field types. For these field types, at least one option value must be provided. Each option will be presented as a selectable choice to the user when they interact with the field.

Example response

201 Created

{
  "message": "Field added successfully.",
  "data": {
    "id": 1
  }
}