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 its content.

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
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
422 BITRIX_ERROR The field with the given id does not exist (or a repeat DELETE after removal) — 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.

Repeat deletion. A repeat DELETE on the same id returns 422 BITRIX_ERROR ("You cannot delete the user field") — there is no separate 404 for an already-deleted field.

See also