[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-partner-connect\u002Fcompany":3,"docs-tabs-partner-connect\u002Fcompany":6},{"content":4,"lastmod":5},"# Company connection\n\n`COMPANY` mode is a shared company connection to Bitrix24, held by an account administrator. This page describes how this mode differs from the personal `PERSONAL` connection. The other pages of the [Partner Connect](\u002Fdocs\u002Fpartner-connect) section describe issuance in `PERSONAL` mode.\n\n## Connection mode\n\nNew clients use `PERSONAL` mode: consent and the key belong to the user. `COMPANY` mode prepares a shared company connection to Bitrix24.\n\n- Only a platform administrator can set this mode.\n- The mode requires a `CONFIDENTIAL` client, a client secret and PKCE `S256`.\n- Device sign-in is incompatible with `COMPANY`: an attempt to enable one while the other is enabled is rejected.\n- The mode can be switched until the client has issued its first key. A history of attempts without issuance does not prevent switching, and unfinished attempts are cancelled on switching.\n- The first issuance locks the mode permanently, even after the keys are revoked. An attempt to change the mode returns `409 CONNECT_COMPANY_MODE_LOCKED`. For Company mode, register a new client.\n- An existing Company connection prevents switching back to `PERSONAL`.\n- The company key is also available on self-hosted portals verified by the platform.\n\n## When issuance is unavailable\n\nIf new issuance for `COMPANY` (`CREATE` and `RECONNECT`) is unavailable, the application receives the following refusals:\n\n| Step | Response |\n|-----|-------|\n| [`GET \u002Fv1\u002Fconnect\u002Fauthorize`](\u002Fdocs\u002Fpartner-connect\u002Fauthorize) | After the redirect address is validated, a redirect to the registered `redirect_uri` with `error=access_denied`, the original `state`, and `error_description` set to `CONNECT_COMPANY_NOT_READY` or `CONNECT_COMPANY_DISABLED`. No authorization code is created |\n| [`POST \u002Fv1\u002Fconnect\u002Ftoken`](\u002Fdocs\u002Fpartner-connect\u002Ftoken) with `grant_type=authorization_code` | HTTP 403 with the refusal code in the `code` and `error_description` fields |\n| [Device sign-in](\u002Fdocs\u002Fpartner-connect\u002Fdevice-authorize) — starting and exchanging the code | HTTP 400, `error=unauthorized_client`, `code=CONNECT_COMPANY_DEVICE_FLOW_FORBIDDEN` |\n| Consent confirmed from a support session acting on behalf of another user | Refusal `CONNECT_COMPANY_IMPERSONATION_FORBIDDEN`, including on an account that permits support access |\n| Too many attempts | HTTP 429 `CONNECT_COMPANY_ATTEMPT_LIMITED`. Retry after the indicated wait time |\n\nDevice sign-in and support session refusals are not lifted by retrying or by selecting another account. `CONNECT_COMPANY_DISABLED` means that the connection is unavailable for the selected user or Bitrix24 account. `CONNECT_COMPANY_NOT_READY` means that the temporary technical conditions for the connection have not yet been met. Rotation of an existing secret has separate conditions — see [Reconnection and secret rotation](#reconnection-and-secret-rotation).\n\n## What the company key can access\n\n### Bitrix24\n\nThe company key acts in Bitrix24 on behalf of the holder — the employee who gave consent as an administrator — within the approved scopes and with write access. Bitrix24 checks the holder's current permissions for the selected employee and object: if the holder's administrator rights are removed, the key works with the permissions of a regular employee.\n\n- **Readiness.** A Bitrix24 connection does not need the `crm` scope: at least one approved Bitrix24 scope, such as `user`, is enough while the holder and connection checks pass. `bitrix_ready` does not mean the key can call any API route: the set of routes and the permissions for specific methods are checked separately.\n- **Scope check.** Before each Bitrix24 call, the platform checks the method against the current consent, including helper calls. The `task` scope is equivalent to `tasks`. The reduced `user_basic` and `user_brief` scopes permit `user.get`, but not methods that need the full `user` scope. An unknown method prefix and a method without the required consent return `403 SCOPE_MISSING` before any request to Bitrix24.\n- **Entities.** The key can perform entity operations, including `\u002Fv1\u002Fusers`, `\u002Fv1\u002Fdepartments` and `\u002Fv1\u002Ftasks`, within the approved scopes: reading, creating, updating, deleting, searching, fields, aggregation, import and batch operations — those the entity supports. Available operations are marked `x-company-access: true` in OpenAPI. Entities available only to OAuth applications and some custom routes are denied with `403 CONNECT_COMPANY_ROUTE_FORBIDDEN`.\n- **The `include` parameter and custom fields** are available within the current consent. Data from different company connections is not mixed.\n- **Writes** are checked by the regular partner key rules, without a read-only restriction. A batch containing a method outside the consent is rejected as a whole before any command is sent.\n- **Search** in windowed mode is not available to the company key: pass `autoWindow: false`.\n- **Extending scopes.** Without the required scope, the response is `403 SCOPE_MISSING`. To add scopes, change the application permissions and ask an account administrator to complete consent with `operation=RECONNECT`.\n\n### Storage and AI\n\n- **Storage** requires explicit `vibe:storage` consent. Without it, storage returns `403 CONNECT_COMPANY_STORAGE_NOT_READY`. Availability is shown by `capabilities.storage` in the [connection poll](\u002Fdocs\u002Fpartner-connect\u002Fcompany-status), independently of the holder check.\n- **AI** requires `vibe:ai` consent and a separate application permission. Current availability is shown by `capabilities.ai`.\n- Issuing derived tokens and keys, as well as managing external model keys, is not allowed: `403 CONNECT_COMPANY_DERIVED_TOKEN_FORBIDDEN`.\n- Unknown routes are rejected: `403 CONNECT_COMPANY_ROUTE_FORBIDDEN`.\n\nThese refusals are not lifted by selecting another Bitrix24 account. Issuance availability depends on the readiness of the selected connection.\n\n### Notifications and working time\n\n**Notifications — with `im` consent.** Available: `POST \u002Fv1\u002Fnotifications` and the read routes `GET \u002Fv1\u002Fnotifications`, `\u002Fv1\u002Fnotifications\u002Fsearch`, `\u002Fv1\u002Fnotifications\u002Fschema`, `\u002Fv1\u002Fnotifications\u002Fgroups`, `\u002Fv1\u002Fnotifications\u002Fsettings`.\n\n- `POST \u002Fv1\u002Fnotifications` sends a personal notification, or a system one with `type=system`, and requires the recipient's `userId` and `message`. A successful response is `201`.\n- `GET \u002Fv1\u002Fnotifications` reads the holder's inbox, not a shared company inbox.\n- Settings without `userId` refer to the holder: this additionally requires `user` consent. With an explicit `userId`, this consent is not needed, and Bitrix24 determines access.\n\n**Working time — with `timeman` consent, read-only.** Available: `GET \u002Fv1\u002Fworkday\u002Fstatus`, `\u002Fv1\u002Fworkday\u002Fsettings`, `\u002Fv1\u002Fworkday\u002Frecords`, `\u002Fv1\u002Fworkday\u002Fschedule`, `\u002Fv1\u002Fworkday\u002Ftime-control\u002Fsettings`, `\u002Fv1\u002Fworkday\u002Ftime-control\u002Freport-settings`, `\u002Fv1\u002Fworkday\u002Ftime-control\u002Fusers`, `\u002Fv1\u002Fworkday\u002Ftime-control\u002Freports`, `\u002Fv1\u002Fworkday\u002Fwork-reports`, `\u002Fv1\u002Fworkday\u002Fwork-reports\u002Fsubordinates`, `\u002Fv1\u002Fworkday\u002Fwork-reports\u002F{id}`, `\u002Fv1\u002Fworkday\u002Fdaily-reports`, `\u002Fv1\u002Fworkday\u002Frecords\u002F{recordId}\u002Freport`.\n\n| Route | Condition |\n|---------|---------|\n| `\u002Fv1\u002Fworkday\u002Fstatus`, `\u002Fv1\u002Fworkday\u002Fsettings` | Without `userId`, return the holder's data |\n| `\u002Fv1\u002Fworkday\u002Frecords` | Requires `userId` and consent to one of `user_brief`, `user_basic` or `user`, even for an empty page |\n| `\u002Fv1\u002Fworkday\u002Ftime-control\u002Fusers` | Requires `departmentId` and `department` consent |\n| `\u002Fv1\u002Fworkday\u002Fschedule` | Requires `id` |\n| `\u002Fv1\u002Fworkday\u002Ftime-control\u002Freports` | Requires `userId`, `month`, `year` |\n| `\u002Fv1\u002Fworkday\u002Fwork-reports`, `\u002Fv1\u002Fworkday\u002Fdaily-reports`, `\u002Fv1\u002Fworkday\u002Fwork-reports\u002F{id}` | Require `userId` |\n| `\u002Fv1\u002Fworkday\u002Fwork-reports\u002Fsubordinates` | Reads the reports of the holder's subordinates |\n\nInsufficient consent returns `403 SCOPE_MISSING`. Other notification actions and working time changes are unavailable to the company key and return `403 CONNECT_COMPANY_ROUTE_FORBIDDEN`. Responses to the company key include `Cache-Control: no-store`.\n\n## Who is connected\n\nA successful `POST \u002Fv1\u002Fconnect\u002Ftoken` response in `COMPANY` mode contains the `portal` and `user` objects at the top level. In the [`GET \u002Fv1\u002Fconnect\u002Fcompany\u002Fstatus`](\u002Fdocs\u002Fpartner-connect\u002Fcompany-status) response, these objects are inside `data`. Names and email addresses come from the platform account — not from the Bitrix24 profile and not from the employee list.\n\n**Who `user` refers to:**\n\n- On `CREATE` — the administrator who gave consent.\n- On `RECONNECT` — the administrator who accepted the new consent.\n- On `ROTATE_SECRET` by another administrator — the previous consent holder: rotation by itself does not transfer consent.\n\nA missing email address is returned as an empty string.\n\n**`user` is `null`** if there is no current consent, it has ended or belongs to another generation, the holder is missing, blocked, deleted or has an `erasureState` other than `ACTIVE`, or the holder's membership is not ready. A stale or failed holder check by itself does not change the identity. The `NEEDS_ADMIN` state without consent returns the Bitrix24 details and `user: null`.\n\n**A snapshot, not a cache.** The objects describe the state at the time of the response. A name or email change does not necessarily increment `revision`, so do not use `revision` to cache the profile. Exchange and status responses, including refusals, come with `Cache-Control: no-store`. The fields do not open additional routes and do not renew the holder check. `api_key` is returned once on `CREATE` and `ROTATE_SECRET` and is absent on `RECONNECT`. Exchange errors do not contain `portal` and `user`.\n\nExample of a successful `CREATE` response in `COMPANY` mode — the secret below is fictional. `bitrix_ready: false` describes the availability of this connection and does not open issuance.\n\n```json\n{\n  \"connection_mode\": \"COMPANY\",\n  \"connection_id\": \"connection-id\",\n  \"portal\": { \"domain\": \"example.bitrix24.com\", \"name\": \"Example\" },\n  \"user\": { \"name\": \"Admin\", \"email\": \"admin@example.com\" },\n  \"status\": \"ACTIVE\",\n  \"generation\": 1,\n  \"credential_version\": 1,\n  \"credential_unchanged\": false,\n  \"bitrix_ready\": false,\n  \"scope\": \"crm\",\n  \"api_key\": \"FAKE-example-only\"\n}\n```\n\n## Reconnection and secret rotation\n\nWhile new issuance is unavailable, `CREATE` and `RECONNECT` receive the refusals from [When issuance is unavailable](#when-issuance-is-unavailable), and secret rotation for an existing connection works.\n\n[`GET \u002Fv1\u002Fconnect\u002Fauthorize`](\u002Fdocs\u002Fpartner-connect\u002Fauthorize) accepts the `operation` parameter:\n\n| `operation` | What it does |\n|-------------|------------|\n| `CREATE` | A new connection. The default value |\n| `RECONNECT` | A new administrator consent. The existing secret is kept: reconnection does not help if the secret may have been stolen |\n| `ROTATE_SECRET` | Replaces the secret. The approved scopes are kept and not extended. Requires `credential_version` equal to the current version. Remains available for an existing connection while new issuance is closed, if the other checks pass |\n\nAll operations require a server-side client with a secret, PKCE `S256`, current consent and a fresh check of Bitrix24 administrator rights.\n\n- For `CREATE` and `RECONNECT`, an authorization code is issued only after the platform has saved the connection candidate and the obligation to clean up the previous webhook.\n- Rotation changes the secret without a new webhook.\n- Additional scopes on `RECONNECT` require a separate explicit consent on the consent screen.\n- The first exchange and a successful rotation show the secret once.\n\n**Refusals:**\n\n| HTTP | Code | What happened |\n|------|-----|---------------|\n| 409 | `CONNECTION_GENERATION_CONFLICT` | Another attempt won. The secret is not returned, and the losing candidate is revoked. Start a new authorization |\n| 409 | `CONNECTION_WEBHOOK_CLEANUP_PENDING` | The limit of unfinished cleanups has been reached. Wait for cleanup to finish |\n| 403 | `CONNECTION_SCOPE_CONSENT_REQUIRED` | Additional scopes have not been confirmed by explicit consent |\n| 403 | `CONNECTION_SUSPENDED` | Ordinary reconnection does not lift a security suspension |\n| 503 | `CONNECTION_ADMIN_CHECK_UNAVAILABLE` | Administrator rights could not be checked. The existing connection is kept |\n\n**Webhook cleanup.** The platform deletes previous webhooks in the background, and this does not close Bitrix24 access: the connection works through the current holder's webhook while cleanup is in progress. A webhook that cannot be deleted stays recorded as a cleanup debt, and `webhook_cleanup` shows `pending` for it. If the outcome of creating a webhook is unknown, the cleanup obligation is kept, and in this case, while the connection has no working webhook, Bitrix24 access is closed with the reason `CONNECTION_WEBHOOK_CLEANUP_PENDING`. Automatic lookup of such a webhook by marker is not enabled.\n\n**Daily caps.** Bitrix24 account caps and connection caps are independent and optional: `null` means no daily cap, not zero requests. Zero is not a valid value. General request limits, protection against frequent attempts, usage accounting and billing always apply. The absence of daily caps by itself does not open issuance. The `CONNECT_COMPANY_DISABLED`, `CONNECT_COMPANY_NOT_READY` and `CONNECT_COMPANY_ATTEMPT_LIMITED` refusals are not related to setting a daily cap.\n\n## Holder departure\n\nA Company connection is held by the employee who completed consent as an account administrator. Administrator rights are needed only at the moment of consent: if they are removed later, the connection keeps working with the permissions of a regular employee. In the cloud, the number of administrators is limited by the plan, and on the Free and Basic plans there is a single administrator, so the holder's rights may change — this does not interrupt the connection.\n\n**When the connection moves to `NEEDS_ADMIN`.** The holder departs: they are dismissed, deactivated or deleted in Bitrix24, become a guest or withdraw their consent, or their platform account is transferred or deleted. Every few minutes the platform checks the holder with the holder's own key. If the holder can no longer authenticate with their own key and a repeat check no earlier than 30 seconds later confirms it, the connection moves to `NEEDS_ADMIN`.\n\nUntil the check passes, Bitrix24 access is closed: the status poll shows `reason_code` — `ADMIN_CHECK_REQUIRED` and `action` — `WAIT`, and working calls receive `503 ADMIN_CHECK_REQUIRED` with the `Retry-After: 30` header. Retry after 30 seconds. After a successful check, access reopens on its own.\n\n**What the status poll shows after the holder departs:**\n\n- `status` — `NEEDS_ADMIN`, `reason_code` — `CONNECTION_ADMIN_REQUIRED`, `action` — `AUTHORIZE_ADMIN`.\n- `generation` and `revision` have increased by 1.\n- `webhook_cleanup` — `pending` while the platform deletes the previous holder's webhook in Bitrix24 or when it cannot be deleted, or `attention_required` if the outcome of creating the webhook is unknown.\n\n**How to restore access.** The connection secret stays valid, and you do not need to change it. Unfinished authorization attempts are cancelled, and unused authorization codes can no longer be exchanged. The person's return to work does not restore the connection: an account administrator restores access by completing consent with `operation=RECONNECT`. Bitrix24 becomes available right after that, and cleanup of the previous holder's webhook continues in the background. If a self-hosted Bitrix24 has no permanent administrator, grant an employee administrator rights for the duration of the reconnection: after consent the rights can be removed, and the connection keeps working.\n\nDeactivation of the application by its owner and blocking of the application by the platform move all of its Company connections to `SUSPENDED` and revoke their secrets.\n\n## See also\n\n- [Company connection polling](\u002Fdocs\u002Fpartner-connect\u002Fcompany-status)\n- [Exchange a code for an API key](\u002Fdocs\u002Fpartner-connect\u002Ftoken)\n- [Start user authorization](\u002Fdocs\u002Fpartner-connect\u002Fauthorize)\n- [Partner Connect](\u002Fdocs\u002Fpartner-connect)\n","2026-11-20",{},1795415493876]