For AI agents: markdown of this page — /docs-content-en/entities/crm-required-fields/set.md documentation index — /llms.txt

Set a CRM field requirement

PUT /v1/deals/fields/required

Set whether a CRM field is required for everyone who edits or saves records in the Bitrix24 account.

Rolling out with crm 26.2000.0. Availability depends on the Bitrix24 account. A disabled feature or missing portal method returns 422 METHOD_NOT_YET_AVAILABLE with error.release. The release line alone does not guarantee that the method is enabled.

Scope crm. READWRITE is required.

Parameters

Resource variants:

PUT /v1/deals/fields/required

PUT /v1/leads/fields/required

PUT /v1/contacts/fields/required

PUT /v1/companies/fields/required

PUT /v1/quotes/fields/required

PUT /v1/invoices/fields/required

PUT /v1/items/:entityTypeId/fields/required

Smart process entityTypeId is a safe integer of at least 128, from smart processes. Use the built-in resource names for other types.

Request body

Field Type Required Description
FieldfieldId Typestring Requiredyes DescriptionNative non-empty CRM field identifier, for example comments or opportunity. See the naming rules below.
FieldcategoryId Typeinteger Requiredyes, except leads and quotes DescriptionNon-negative funnel ID from deal categories or categories. Bitrix24 checks whether it applies.
FieldrequiredStageIds Typestring[] Requiredno DescriptionOmit for the entire funnel or global requirement. A non-empty list selects stages. [] clears the setting.

Use only a flat JSON body, without a fields wrapper or query parameters.

Leads and quotes do not accept categoryId. Other types require it. 0 selects the default category for deals, contacts and companies. Invoices and smart processes need an existing positive category ID. These rules are checked by Bitrix24.

Standard field identifiers use native CRM names. The amount field is opportunity, although the V1 entity API calls it amount. V1 aliases are not converted.

For a custom field, use the original UF_* value from fieldName in CRM user fields or smart process user fields. Smart invoices use /v1/userfields/invoices. Do not use the ufCrm... alias from the entity dictionary. Field identifiers are not converted.

Examples

curl — personal key

Terminal
curl -X PUT "https://vibecode.bitrix24.com/v1/deals/fields/required" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fieldId": "comments", "categoryId": 0}'

curl — OAuth application

Terminal
curl -X PUT "https://vibecode.bitrix24.com/v1/deals/fields/required" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"fieldId": "comments", "categoryId": 0}'

JavaScript — personal key

javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/deals/fields/required', {
  "method": "PUT",
  "headers": {
    "X-Api-Key": "YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  "body": "{\"fieldId\": \"comments\", \"categoryId\": 0}"
})
const result = await response.json()
console.log(result)

JavaScript — OAuth application

javascript
const response = await fetch('https://vibecode.bitrix24.com/v1/deals/fields/required', {
  "method": "PUT",
  "headers": {
    "X-Api-Key": "YOUR_APP_KEY",
    "Authorization": "Bearer USER_SESSION_TOKEN",
    "Content-Type": "application/json"
  },
  "body": "{\"fieldId\": \"comments\", \"categoryId\": 0}"
})
const result = await response.json()
console.log(result)

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue
Fielddata.fieldId Typestring DescriptionField identifier.
Fielddata.categoryId Typeinteger or null DescriptionFunnel context, or null for a global setting.
Fielddata.mode Typestring Descriptionnone — no setting; all — required throughout; stages — required at selected stages.
Fielddata.requiredStageIds Typestring[] DescriptionRequired stages.
Fielddata.globallyRequired Typeboolean DescriptionField is globally required by the platform.

Response example

JSON
{
  "success": true,
  "data": {
    "fieldId": "comments",
    "categoryId": 0,
    "mode": "all",
    "requiredStageIds": [],
    "globallyRequired": false
  }
}

Error response example

400 — missing field identifier:

JSON
{
  "success": false,
  "error": {
    "code": "INVALID_PARAMS",
    "message": "fieldId must be a non-empty string"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionMalformed parameters or body.
HTTP400 CodeINVALID_FIELDS DescriptionUnknown body field.
HTTP400 CodeUNKNOWN_FILTER_FIELD DescriptionUnknown or misplaced query parameter.
HTTP400 CodeINVALID_ENTITY_TYPE DescriptionInvalid smart process type.
HTTP401 CodeTOKEN_MISSING DescriptionMissing portal credentials.
HTTP403 CodeSCOPE_DENIED DescriptionMissing crm scope.
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionWrite through a read-only key.
HTTP404 CodeNative Bitrix24 code DescriptionField or context not found.
HTTP409 CodeNative Bitrix24 code DescriptionConfiguration conflict.
HTTP422 CodeMETHOD_NOT_YET_AVAILABLE DescriptionFeature is off or the method is unavailable. error.release identifies the release line.
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionMalformed upstream response.

Common errors.

Known specifics

Clearing a setting does not override a system field that Bitrix24 makes globally required. Unknown fields and invalid stage or funnel combinations are rejected by Bitrix24 with its original code and message.

See also