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

Update an API key

PATCH /v1/keys/:id

Changes the settings of an API key owned by the management key owner. The body is flat, without a fields wrapper: pass only the fields that change.

Parameters

Parameter Type Required Description
Parameterid (path) Typestring Requiredyes DescriptionKey record ID. List: GET /v1/keys

Request fields (body)

Field Type Required Description
Fieldname Typestring Requiredno DescriptionKey name, from 1 to 255 characters. A whitespace-only name is not accepted
Fieldscopes Typestring[] Requiredno DescriptionNew full list of the key's scopes, at least one. The scope set is checked the same way as on creation. The vibe:storage scope is added only to a personal key. For an application key or a key of unknown origin it can be re-sent unchanged or removed
Fieldstatus Typestring Requiredno DescriptionACTIVE — return the key to service, REVOKED — revoke it
Fieldmode Typestring Requiredno DescriptionKey access mode: READWRITE or READONLY. Details — Access mode. Switching to READWRITE is forbidden if the Bitrix24 account policy requires READONLY
FieldipWhitelist Typestring[] Requiredno DescriptionAllowed IP addresses. An empty array removes the restriction
FieldexpiresAt Typestring | null Requiredno DescriptionExpiration date in ISO 8601 format. null — the key never expires
FieldrateLimit Typenumber | null Requiredno DescriptionIndividual request limit for AI endpoints. Only the key's current value is accepted: a change returns 403 RATE_LIMIT_ADMIN_ONLY
FieldtotalDefault Typeboolean | null Requiredno DescriptionWhether meta.total is returned in lists requested with this key. null — the platform setting applies

Examples

The request accepts only a management key — see Limitations.

curl — management key

Terminal
curl -X PATCH "https://vibecode.bitrix24.com/v1/keys/6dbad0ce-79a9-43f5-8ca4-3e1af7ef63bc" \
  -H "X-Api-Key: YOUR_MANAGEMENT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "CRM and tasks integration"
  }'

JavaScript — management key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/keys/6dbad0ce-79a9-43f5-8ca4-3e1af7ef63bc', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_MANAGEMENT_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'CRM and tasks integration',
  }),
})

const { success, data } = await res.json()
console.log('Key:', data.name, '—', data.status)

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata.id Typestring DescriptionKey record ID
Fielddata.name Typestring DescriptionKey name
Fielddata.prefix Typestring DescriptionFirst characters of the key value
Fielddata.suffix Typestring DescriptionLast four characters of the key value
Fielddata.type Typestring DescriptionKey record type, always APP
Fielddata.userId Typestring DescriptionKey owner ID
Fielddata.portalId Typestring DescriptionBitrix24 account ID
Fielddata.clientId Typestring | null DescriptionOAuth client ID, if one is recorded on the key. Otherwise null
Fielddata.scopes Typearray DescriptionKey scopes after the change
Fielddata.ipWhitelist Typearray DescriptionAllowed IP addresses. An empty array — no restriction
Fielddata.expiresAt Typestring | null DescriptionExpiration date (ISO 8601), null — never expires
Fielddata.rateLimit Typenumber | null DescriptionIndividual request limit for AI endpoints, null — the platform-wide limit
Fielddata.status Typestring DescriptionACTIVE, REVOKED, EXPIRED or BLOCKED
Fielddata.lastUsedAt Typestring | null DescriptionDate of the last request made with this key (ISO 8601)
Fielddata.createdAt Typestring DescriptionCreation date (ISO 8601)
Fielddata.updatedAt Typestring DescriptionLast modification date (ISO 8601)
Fielddata.accessMode Typestring DescriptionREADWRITE or READONLY
Fielddata.totalDefault Typeboolean | null DescriptionWhether meta.total is returned in lists requested with this key. null — the platform setting applies
Fielddata.issuedVia Typestring | null DescriptionChannel through which the key's webhook was issued: per-portal and cloud-shared — the connector module on the Bitrix24 account, dev_key — the owner's developer key, legacy — registration via Bitrix24 Network, none — no webhook was created. null if the channel is not recorded

The response has no b24Ready field. To get it, call GET /v1/keys/:id.

Response example

JSON
{
  "success": true,
  "data": {
    "id": "6dbad0ce-79a9-43f5-8ca4-3e1af7ef63bc",
    "name": "CRM and tasks integration",
    "prefix": "vibe_api_XXXXXXXXX",
    "suffix": "XXXX",
    "type": "APP",
    "userId": "fafa9780-eed7-4d29-b040-2448d924f452",
    "portalId": "0d9f7744-f853-47c7-b06e-6f61f9dd1b7f",
    "clientId": null,
    "scopes": ["crm", "task", "tasks", "im"],
    "ipWhitelist": [],
    "expiresAt": null,
    "rateLimit": null,
    "status": "ACTIVE",
    "lastUsedAt": "2026-10-28T13:11:06.013Z",
    "createdAt": "2026-05-18T10:22:10.950Z",
    "updatedAt": "2026-10-29T12:16:49.962Z",
    "accessMode": "READWRITE",
    "totalDefault": null,
    "issuedVia": null
  }
}

Error response example

403 — a Bitrix24 scope is being added to an application authorization key:

JSON
{
  "success": false,
  "error": {
    "code": "OAUTH_SCOPE_CHANGE_REQUIRES_REISSUE",
    "message": "An OAuth app's permissions can't be changed on an existing key — they're fixed when the key is issued. Create a new authorization key with the scopes you need."
  }
}

Errors

HTTP Code Description
HTTP400 CodeVALIDATION_ERROR DescriptionA body field failed validation: a whitespace-only name or one longer than 255 characters, an unknown status, mode or scope value, an empty scopes list, an invalid IP address, rateLimit outside the range from 1 to 100,000
HTTP400 CodeINVALID_JSON_BODY DescriptionThe request body is invalid JSON
HTTP400 CodePERSONAL_KEY_WEBHOOK_SCOPES_INVALID DescriptionThe new scopes list contains no data scope: only placement, entity and userfieldtype are left. The check runs before the Bitrix24 account is contacted
HTTP400 CodePERSONAL_KEY_WEBHOOK_SCOPES_INVALID DescriptionThe Bitrix24 account refused to store all Bitrix24 scopes from the new list on the key's webhook. The key's scopes do not change
HTTP400 CodeINVALID_SCOPES DescriptionSome of the new scopes are unavailable on the Bitrix24 account. The key's scopes do not change
HTTP400 CodeBOX_NO_DEVELOPER_KEY DescriptionBitrix24 scopes are changed on a Bitrix24 account where they are checked on the Bitrix24 side, and the key owner has no developer key. The key's scopes do not change
HTTP402 CodeACCOUNT_FROZEN DescriptionThe account balance is frozen. A request whose body is only {"status": "REVOKED"} goes through on a frozen account as well
HTTP403 CodeKEY_BLOCKED DescriptionThe key is blocked (status: BLOCKED) and cannot be changed. It can be replaced only by rotation
HTTP403 CodeRATE_LIMIT_ADMIN_ONLY DescriptionThe request changes rateLimit. An individual limit cannot be changed through this endpoint
HTTP403 CodeKEY_POLICY_READONLY_REQUIRED DescriptionThe request switches the key to READWRITE, and the Bitrix24 account policy requires READONLY for keys. An exception for an individual key is granted by the Bitrix24 account administrator
HTTP403 CodeOAUTH_SCOPE_CHANGE_REQUIRES_REISSUE DescriptionA Bitrix24 scope is being added to an application authorization key (vibe_app_). The scopes of such a key are fixed at issue time — create a new authorization key with the required set. Removing scopes goes through
HTTP403 CodeKEY_STORAGE_SCOPE_REQUIRES_PERSONAL_KEY DescriptionThe new list adds vibe:storage to an application key or a key of unknown origin. Create a new personal key with storage access
HTTP403 CodeINFRA_DISABLED_FOR_PORTAL DescriptionThe new list adds the vibe:infra scope, which the key did not carry, and the Bitrix24 account administrator has turned server management off. The key's scopes do not change. Editing a key that already carries this scope goes through on such an account as well, and removing the scope is always allowed
HTTP403 CodeSCOPE_NOT_AVAILABLE_ON_PORTAL DescriptionThe new list adds a scope that is not granted on this Bitrix24 account. The message names such scopes
HTTP403 CodeSYSTEM_KEY_REACTIVATE_FORBIDDEN DescriptionThe request switches to ACTIVE, or extends the expiry of, a key that the platform issues through its own endpoint: a Cowork/Code desktop app key, an agent key, a project deploy key. The response message says where to reissue this key
HTTP403 CodeCOWORK_PLATFORM_DISABLED DescriptionA key billed to the Cowork/Code subscription is being switched to ACTIVE or extended, and Cowork/Code is disabled at the platform level
HTTP403 CodeCOWORK_ACCESS_REQUIRED DescriptionThe same for a subscription key: the key owner has no access to Cowork/Code
HTTP403 CodeCOWORK_EXTERNAL_CLIENTS_DISABLED DescriptionThe same for a subscription key: the Bitrix24 account administrator has forbidden third-party clients
HTTP403 CodeCOWORK_SUBSCRIPTION_INACTIVE DescriptionThe same for a subscription key: the Cowork/Code subscription is suspended or cancelled
HTTP403 CodeCOWORK_SEAT_KEY_MODE_CABINET_ONLY DescriptionThe request changes mode on a Cowork/Code desktop app key. This is the mode of the whole seat. Change it in the Vibecode dashboard, which shows what else narrows along with it
HTTP403 CodeCOWORK_KEY_MODE_ABOVE_SEAT DescriptionThe request raises mode on a third-party agent key billed to the Cowork/Code subscription above the seat mode. Widen the seat first; within its limits the edit goes through. The same code is returned if the seat was narrowed while the request was running
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe management key that sent the request works in READONLY mode
HTTP403 CodeMANAGEMENT_SCOPE_REQUIRED DescriptionThe management key does not carry the vibe:mgmt:keys scope
HTTP404 CodeKEY_NOT_FOUND DescriptionThere is no key with this id, it belongs to another user, or it is a management key
HTTP409 CodeREISSUE_IN_PROGRESS DescriptionAuthorization key (vibe_app_) only: the request changes mode, status or expiresAt, and another operation is already running on this application's key — a rotation, an update or a deletion. The key is not changed; retry the request once that operation finishes
HTTP409 CodeKEY_NOT_ACTIVE DescriptionAuthorization key (vibe_app_) only: the key is no longer active or has changed since the request started — for example, it was revoked or deleted. Changing mode on a revoked authorization key also returns this code. The key is not changed. Re-read it with GET /v1/keys/:id
HTTP409 CodeKEY_MANAGES_FOREIGN_SERVER DescriptionRevoking a key that manages a live server of another owner, a server without an owner, or a server of the same owner on another Bitrix24 account. Identify the server's owner and its Bitrix24 account, then rebind the server to a key of that owner on the same Bitrix24 account and retry the revocation
HTTP409 CodeKEY_OPERATION_IN_PROGRESS DescriptionA transfer, revocation or concurrent scope edit of the key has not finished yet. Re-read the key and retry the edit against its current scope set
HTTP409 CodePORTAL_ADDRESS_CHANGED DescriptionA self-hosted Bitrix24 portal has moved to a new address, while the key's webhook is issued for the previous one. No request is sent to the Bitrix24 account, and the key's scopes change neither on the Vibecode platform nor in Bitrix24. Reconnect the key and repeat the edit — the steps are in Authorization, keys and permissions
HTTP410 CodeSTALE_DEVELOPER_KEY DescriptionThe owner's developer key is invalid and is not re-issued automatically. The key's scopes do not change. Reconnect the account
HTTP502 CodeRECOVERY_FAILED DescriptionReissuing the developer key failed. The failure is temporary — retry the request
HTTP502 CodeDEVKEY_SCOPE_SYNC_FAILED DescriptionBitrix24 did not accept the new scopes of the key's webhook. Diagnostics are in error.details. The key's scopes do not change
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionThe key status change could not be passed to Bitrix24
HTTP401 CodeWRONG_KEY_TYPE DescriptionThe request was sent with a Bitrix24 account key — a personal vibe_api_ key or an authorization key vibe_app_. The endpoint accepts only a management key
HTTP401 CodeKEY_INACTIVE DescriptionThe management key is revoked or blocked
HTTP401 CodeKEY_EXPIRED DescriptionThe management key has expired
HTTP401 CodeINVALID_API_KEY DescriptionNo key with the provided value was found
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is missing

The OWNER_DELETED, OWNER_BLOCKED and ACCOUNT_PENDING_ERASURE refusals depend on the key owner's account — see Owner account state.

Full list of common API errors — Errors.

Known specifics

The access mode is changed with the mode field. The accessMode field from the response is not accepted in the request body: a request with it returns 200, and the key mode does not change.

A value equal to the current one is not a change. A client may send the whole key record to rename it: the same mode, the same rateLimit and the same scopes set go through without the checks that run when these fields change.

Scopes and status change in Bitrix24 as well. If the key's scopes are checked on the Bitrix24 side, the new set is first passed to the key's webhook and only then stored in Vibecode. If the Bitrix24 account refuses, the key keeps its previous scopes. On revocation the platform deletes the key's webhook in Bitrix24 or disables its credentials.

Revocation cancels the access tokens issued by the key. Together with the switch to REVOKED, the server access tokens issued by this key are revoked.

Platform-issued keys are checked only when returned to service or extended. Shortening the expiry, revoking and editing other fields of such keys work without the issuance checks. Ordinary dashboard keys are not affected by these checks.

The mode of Cowork/Code keys lives on the seat. A seat is a pair of an employee and a Bitrix24 account, shared by all of the employee's devices. So the mode of a desktop app key cannot be changed here, and on a third-party agent key billed to the subscription it is capped by the seat mode.

See also