For AI agents: markdown of this page — /docs-content-en/entities/activities/bindings/unbind.md documentation index — /llms.txt

Unbind

DELETE /v1/activities/:activityId/bindings

Removes the activity's binding to a given CRM entity. The activity no longer shows in that entity's timeline but stays in the timelines of the other bound entities.

Parameters

Parameter Type Required Description
ParameteractivityId (path) Typenumber Requiredyes DescriptionActivity ID. List: GET /v1/activities
ParameterentityTypeId (query or body) Typenumber Requiredyes DescriptionNumeric entity-type code:
1 — lead
2 — deal
3 — contact
4 — company
7 — quote
31 — invoice
≥128 — smart-process, its code — in GET /v1/smart-processes
ParameterentityId (query or body) Typenumber Requiredyes DescriptionID of the entity to unbind from

Both entityTypeId and entityId are required, but each can be passed as a query parameter or in the JSON request body. For each field, the query value takes precedence over the body value.

Examples

curl — personal key

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/activities/3631/bindings?entityTypeId=3&entityId=9" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/activities/3631/bindings?entityTypeId=3&entityId=9" \
  -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/activities/3631/bindings?entityTypeId=3&entityId=9', {
  method: 'DELETE',
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

const { data } = await res.json()

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/activities/3631/bindings?entityTypeId=3&entityId=9', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata.activityId Typenumber DescriptionActivity ID
Fielddata.entityTypeId Typenumber DescriptionNumeric type code of the unbound entity
Fielddata.entityId Typenumber DescriptionID of the unbound entity
Fielddata.deleted Typeboolean Descriptiontrue only if Bitrix24 returned the boolean value true. Otherwise false

Response example

JSON
{
  "success": true,
  "data": {
    "activityId": 3631,
    "entityTypeId": 3,
    "entityId": 9,
    "deleted": true
  }
}

Error response example

422 — attempting to remove the only binding:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "You cannot delete the only binding of an activity to an entity"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionactivityId, entityTypeId or entityId is not a positive integer
HTTP404 CodeENTITY_NOT_FOUND DescriptionNo activity exists for the given activityId
HTTP422 CodeBITRIX_ERROR DescriptionAttempt to remove the activity's only remaining binding
HTTP403 CodeSCOPE_DENIED DescriptionThe key lacks the crm scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key's access mode blocks binding changes
HTTP401 CodeTOKEN_MISSING DescriptionThe key has no configured tokens

Full list of common API errors — Errors.

Known specifics

You cannot remove the last binding. An activity must stay bound to at least one entity — an attempt to unbind the only one returns 422 and the binding is kept.

Moving an activity to another record. To move an activity without breaking the ban on removing the last binding, see Move a binding — it describes the safe order and a single-call move within the same type.

See also