For AI agents: markdown of this page — /docs-content-en/userfields/smart-processes/delete.md documentation index — /llms.txt

Delete field

DELETE /v1/items/:entityTypeId/userfields/:id

Deletes a smart process user field along with all of its values in items. A deleted field cannot be restored via the API — create a new one if needed.

Parameters

Parameter Type Required Description
:entityTypeId (path) number yes Smart process type identifier. Source: GET /v1/smart-processes — the entityTypeId field on each element of the data array
:id (path) number yes Numeric field identifier (from the response of GET /v1/items/:entityTypeId/userfields or POST /v1/items/:entityTypeId/userfields)

Examples

curl — personal key

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/items/174/userfields/8210" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/items/174/userfields/8210" \
  -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/items/174/userfields/8210',
  {
    method: 'DELETE',
    headers: {
      'X-Api-Key': 'YOUR_API_KEY',
    },
  }
)

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

JavaScript — OAuth application

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

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

Response

On successful deletion, an HTTP 204 No Content status is returned with an empty body. The success indicator is the response code, not the body.

Response example

http
HTTP/1.1 204 No Content

Error response example

403 — the key has no userfieldconfig scope:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ACCESS_DENIED",
    "message": "The request requires higher privileges than provided by the webhook token"
  }
}

Errors

HTTP Code Description
400 INVALID_ENTITY_TYPE_ID :entityTypeId is not a positive integer
400 INVALID_PARAMS :id is not a positive integer or exceeds 9007199254740991. The value must contain digits only, with no leading zero, sign, fractional part, exponent or spaces. The field is not deleted
403 BITRIX_ACCESS_DENIED The key has no userfieldconfig scope — reissue the key with this scope
403 SCOPE_DENIED The API key has no crm scope
404 SMART_PROCESS_NOT_FOUND A smart process with the given entityTypeId was not found on the portal
404 ENTITY_NOT_FOUND The smart process in the path has no field with the given id: the field is already deleted or belongs to another entity. Nothing is deleted
422 BITRIX_ERROR The field was deleted between the check and the deletion — Bitrix24 responds "You cannot delete the user field"
401 TOKEN_MISSING The API key has no configured tokens
401 MISSING_API_KEY The X-Api-Key header is missing

Full list of common API errors — Errors.

Known specifics

Values in items are deleted permanently. When a field is deleted, all of its values in existing smart process items are lost. If the field is used in automations, automation rules, or integrations, check the dependencies before deleting.

Only a field of the smart process in the path is deleted. Field IDs are shared across all entities of the Bitrix24 account, so before deleting, the platform checks that the smart process :entityTypeId has a field with this id. A field of another entity is not deleted; the response is 404 ENTITY_NOT_FOUND.

Repeated deletion. A repeated DELETE on the same id returns 404 ENTITY_NOT_FOUND: the field is already deleted.

See also