For AI agents: markdown of this page — /docs-content-en/entities/requisite-links/update.md documentation index — /llms.txt

Update a requisite link

PATCH /v1/requisite-links/:entityTypeId/:entityId

Partially updates an existing link: only the fields you pass change — the rest are preserved. The owner pair entityTypeId and entityId is taken from the path and does not change. A full overwrite of all four links is available via POST /v1/requisite-links.

Parameters

Parameter Type Required Description
ParameterentityTypeId (path) Typenumber Requiredyes DescriptionLink owner type. Values — Link fields
ParameterentityId (path) Typenumber Requiredyes DescriptionOwner entity ID

Request fields (body)

Pass only the fields you want to change. Omitted fields keep their current value. Pass 0 to clear a link.

Field Type Required Description
FieldrequisiteId Typenumber Requiredno DescriptionClient requisite ID. Source: GET /v1/requisites. 0 — clear the link
FieldbankDetailId Typenumber Requiredno DescriptionClient bank detail ID. Source: GET /v1/bank-details. 0 — clear the link
FieldmcRequisiteId Typenumber Requiredno DescriptionYour company's requisite ID. Source: GET /v1/requisites. 0 — clear the link
FieldmcBankDetailId Typenumber Requiredno DescriptionYour company's bank detail ID. Source: GET /v1/bank-details. 0 — clear the link

Examples

curl — personal key

Terminal
curl -X PATCH "https://vibecode.bitrix24.com/v1/requisite-links/2/3773" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "requisiteId": 46
  }'

curl — OAuth application

Terminal
curl -X PATCH "https://vibecode.bitrix24.com/v1/requisite-links/2/3773" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "requisiteId": 46
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/requisite-links/2/3773', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    requisiteId: 46,
  }),
})

const { success, data } = await res.json()
console.log('Updated link for entityId:', data.entityId)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/requisite-links/2/3773', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    requisiteId: 46,
  }),
})

const { success, data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typeobject DescriptionLink state after the update
Fielddata.entityTypeId Typenumber DescriptionOwner type from the path
Fielddata.entityId Typenumber DescriptionOwner ID from the path
Fielddata.requisiteId Typenumber DescriptionResulting client requisite ID, 0 — not linked
Fielddata.bankDetailId Typenumber DescriptionResulting client bank detail ID, 0 — not linked
Fielddata.mcRequisiteId Typenumber DescriptionYour company's resulting requisite ID, 0 — not linked
Fielddata.mcBankDetailId Typenumber DescriptionYour company's resulting bank detail ID, 0 — not linked
Fielddata.updated Typeboolean DescriptionAlways true on success

Response example

HTTP status: 200 OK

JSON
{
  "success": true,
  "data": {
    "entityTypeId": 2,
    "entityId": 3773,
    "requisiteId": 46,
    "bankDetailId": 12,
    "mcRequisiteId": 3,
    "mcBankDetailId": 7,
    "updated": true
  }
}

Error response example

404 — no link exists for the given pair:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Not found"
  }
}

Errors

HTTP Code Description
HTTP404 CodeENTITY_NOT_FOUND DescriptionNo link for the entityTypeId and entityId pair — create it via POST /v1/requisite-links
HTTP400 CodeINVALID_ANCHOR DescriptionentityTypeId or entityId in the path is not a positive integer
HTTP400 CodeINVALID_REQUEST DescriptionThe request body is not an object
HTTP422 CodeBITRIX_ERROR DescriptionThe link was rejected — for example, a requisite cannot be linked to a deal that has no client selected
HTTP403 CodeSCOPE_DENIED DescriptionAPI key lacks the crm scope
HTTP401 CodeTOKEN_MISSING DescriptionAPI key has no configured tokens

Full list of common API errors — Errors.

Known specifics

An update does not create a link. For a missing pair, PATCH returns 404. To create a link or fully overwrite all four links, use POST /v1/requisite-links.

The link key does not change. entityTypeId and entityId come from the path and are not updated. To re-link a requisite to a different owner, delete the old link and register a new one.

An omitted field and 0 are different things. An omitted field keeps its current value, while an explicit 0 clears the link.

See also