For AI agents: markdown of this page — /docs-content-en/entities/crm-field-enum/delete.md documentation index — /llms.txt

Delete a list field value

DELETE /v1/userfields/:entity/enum-values/:id

Deletes one option of a CRM list custom field. The API cannot restore a deleted option.

Availability. An administrator must enable this feature. It requires a CRM update newer than version 26.2200.0. The exact release version has not yet been determined. If unavailable, the API returns 422 METHOD_NOT_YET_AVAILABLE with error.release.

Alternative path for Smart Process Automation and invoices: DELETE /v1/items/:entityTypeId/userfields/enum-values/:id.

Parameters

Parameter Type Required Description
Parameterentity (path) Typestring Requiredyes Descriptiondeals, leads, contacts, companies, quotes, invoices
Parameterid (path) Typenumber Requiredyes DescriptionValue ID. Source: List field values
ParameterentityTypeId (path) Typenumber Requiredyes for the alternative path DescriptionFor the alternative path: a Smart Process Automation type ID, or 31 for invoices

Examples

curl — personal key

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/userfields/deals/enum-values/4119" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/userfields/deals/enum-values/4119" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/userfields/deals/enum-values/4119', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

if (res.status === 204) {
  console.log('Value deleted')
}

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/userfields/deals/enum-values/4119', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

if (res.status === 204) {
  console.log('Value deleted')
}

Response

A successful deletion returns 204 No Content with an empty body. Check the response status.

Response example

http
HTTP/1.1 204 No Content

Error response example

404: deleting a value that has already been deleted:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Record with ID = `4119` was not found"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionA parameter has an invalid type or shape
HTTP400 CodeUNKNOWN_FILTER_FIELD DescriptionAn unknown or repeated query parameter
HTTP401 CodeMISSING_API_KEY DescriptionThe API key is missing
HTTP401 CodeTOKEN_MISSING DescriptionThe key has no Bitrix24 credentials
HTTP403 CodeSCOPE_DENIED DescriptionThe key lacks the crm scope
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionBitrix24 denied permission for this operation
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key allows reads only
HTTP404 CodeENTITY_NOT_FOUND DescriptionThe list value was not found
HTTP422 CodeMETHOD_NOT_YET_AVAILABLE DescriptionThe feature is disabled or unavailable on this portal. error.release identifies the required update
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 refused the request. See error.message
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 returned an invalid response

For shared API errors, see Errors.

See also