[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-partner-connect\u002Fkeys":3,"docs-tabs-partner-connect\u002Fkeys":6},{"content":4,"lastmod":5},"# Key lifetime, revocation and limit\n\nHow long the authorization code and the issued API key live, who revokes a key and how, and how many keys one user can accumulate in a Bitrix24 account.\n\n## Validity and revocation\n\n- **The authorization code (`code`)** is valid for **5 minutes** and is single-use. After the exchange via `\u002Fv1\u002Fconnect\u002Ftoken`, a repeat call with the same code returns `invalid_grant`.\n- **The consent state** — the internal state of the consent page — lives for 10 minutes. If the user does not confirm within that time, the link has to be issued again.\n- **The API key** has no expiration. It works until it is revoked. Revocation happens in one of four ways:\n\n  1. **The user revokes access themselves** — the \"Connected apps\" section of their Vibecode profile. This revokes **all** keys they issued to your application for this Bitrix24 account, including keys from earlier authorizations. Access granted by other employees of the same Bitrix24 account is not affected.\n  2. **The application revokes its own key** — [`POST \u002Fv1\u002Fconnect\u002Frevoke`](\u002Fdocs\u002Fpartner-connect\u002Frevoke). Exactly one key is revoked: the one you presented.\n  3. **A platform administrator** revokes the keys issued by the client.\n  4. **The application owner deletes the client permanently** — in the [Connect dashboard](\u002Fconnect-apps), first choose \"Deactivate\", then in the menu of the inactive application choose \"Delete permanently\" and confirm the action. All keys of this client stop working, and its short address becomes available. A deleted client cannot be restored. Owners cannot permanently delete official applications.\n\n  **Deactivating a client does NOT revoke keys** — it only stops new keys from being issued: with an inactive client `\u002Fv1\u002Fconnect\u002Fauthorize` rejects the request, while keys already issued keep working.\n\nWhen a key is revoked, all requests with it return `401 KEY_INACTIVE`. If the key is deleted or unknown, the response is `401 INVALID_API_KEY`. The partner must handle both codes correctly and prompt the user to authorize again.\n\n## Re-authorization issues a new key\n\nEvery pass through the consent page issues a **new** API key. The previous key of the same \"user and Bitrix24 account\" pair keeps working: authorization does not revoke it. The user's profile shows both keys as one connection, and revoking access revokes them together.\n\nWhat this means for the application:\n\n- Store the key you received last and replace the previous one with it, otherwise you accumulate working keys you do not keep track of.\n- Every re-authorization takes a slot in the key limit — see below.\n- A key that is no longer valid cannot be restored: obtain a new one through `\u002Fv1\u002Fconnect\u002Fauthorize`.\n\n## Key limit\n\nOne \"user and Bitrix24 account\" pair holds at most 100 valid keys — this is both the default value and the highest value the setting accepts. A Bitrix24 account administrator can set another value, from 1 to 100. The count covers the user's keys in this Bitrix24 account from all applications, not only the ones issued to yours. Keys of the Cowork desktop app do not take a slot.\n\nIn addition to the per-user limit, a Bitrix24 account without a commercial plan has an account-level platform cap — it is counted across all live keys of the Bitrix24 account and cannot be raised by a Bitrix24 account administrator. Once either limit is reached, issuance is refused with the code `KEY_LIMIT_REACHED`: the user sees the reason on the consent page, while the application receives only this code in `error_description` on the return to `redirect_uri`. For the per-user limit, a slot is freed by deleting unneeded keys in the [\"API Keys\"](\u002Fkeys) section of the Vibecode dashboard or by revoking the application's access in the profile. For the account-level cap, the consent screen offers a plan with a higher key limit. Deleting keys also frees capacity once the total number of valid keys of the Bitrix24 account falls below the cap.\n\n## See also\n\n- [Revoke a key as the application](\u002Fdocs\u002Fpartner-connect\u002Frevoke)\n- [Exchange the code for an API key](\u002Fdocs\u002Fpartner-connect\u002Ftoken)\n- [Partner Connect](\u002Fdocs\u002Fpartner-connect)\n","2026-11-19",{},1795415494503]