#Delete a smart process type
DELETE /v1/smart-processes/:entityTypeId
Deletes a smart process type by entityTypeId. Along with the type, all metadata related to it is deleted: pipelines, stages, access permissions, business process settings.
You can delete only a type that has no items. If the type has at least one item — first delete the items via DELETE /v1/items/:entityTypeId/:id or move them to another type.
#Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
entityTypeId (path) |
number | yes | Entity type ID. List: GET /v1/smart-processes |
#Examples
#curl — personal key
curl -X DELETE "https://vibecode.bitrix24.tech/v1/smart-processes/1050" \
-H "X-Api-Key: YOUR_API_KEY"
#curl — OAuth application
curl -X DELETE "https://vibecode.bitrix24.tech/v1/smart-processes/1050" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
#JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.tech/v1/smart-processes/1050', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
if (res.status === 204) {
console.log('Type deleted')
} else {
const { error } = await res.json()
console.error('Error:', error.code, error.message)
}
#JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.tech/v1/smart-processes/1050', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
if (res.status === 204) {
console.log('Type deleted')
}
#Response
On successful deletion the HTTP status 204 No Content with an empty body is returned — success is checked by the status.
#Response example
HTTP/1.1 204 No Content
#Error response example
404 — type not found:
{
"success": false,
"error": {
"code": "SMART_PROCESS_NOT_FOUND",
"message": "Smart process with entityTypeId=99999 not found"
}
}
#Errors
| HTTP | Code | Description |
|---|---|---|
| 401 | MISSING_API_KEY |
The X-Api-Key header was not passed |
| 401 | INVALID_API_KEY |
The key was not found or was revoked |
| 403 | SCOPE_DENIED |
The API key does not have the crm scope |
| 401 | TOKEN_MISSING |
The API key has no configured tokens |
| 404 | SMART_PROCESS_NOT_FOUND |
A type with this entityTypeId was not found. Message: Smart process with entityTypeId=X not found |
| 422 | BITRIX_ERROR |
The type has items (message: You cannot delete an entity type that has items) or another error from Bitrix24 |
Full list of general API errors — Errors.
#Known specifics
Deletion is irreversible. There is no recycle bin and no rollback — a deleted type cannot be restored. The related metadata (pipelines, stages, permissions) is deleted along with the type.
Check the number of items before deleting. If in doubt, get the count:
curl -X POST "https://vibecode.bitrix24.tech/v1/items/1050/aggregate" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"count": true}'
If count > 0 — first delete the items or move them to another type.
entityTypeId is not reused. After deletion, Bitrix24 will not assign this same entityTypeId to a new type — on the next creation you will get a new value from the ≥ 1030 range.
Relations in other types remain. If another type references the deleted one via relations.parent or relations.child, the relation in its settings is preserved but becomes "dangling". Configure relations in the remaining types after deletion.
#See also
- List types — check which types exist on the portal
- Get type — check the state before deletion
- Update type — an alternative to deletion: clear flags to let the type "cool down"
- Item aggregation — check the number of items before deletion
- Delete item — delete the items of a type before deleting the type itself
- Limits and optimization — rate limits