لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/bizproc-robots.md فهرس التوثيق — /llms.txt
مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.
Automation rules
Register your own automation rules to automate Bitrix24. An automation rule is an external handler that appears both in the Automation rules section and in the business process designer. It is invoked when automation runs: it receives input parameters, runs its logic on the application side, and returns a result. Bitrix24 recommends automation rules over activities.
Automation rules can be read, registered, updated, and deleted only with an authorization key vibe_app_… — an API key vibe_api_… cannot be used for these methods. Only a Bitrix24 account administrator can manage automation rules.
Bitrix24 API: bizproc.robot.*
Scope: bizproc
Register an automation rule
POST /v1/bizproc-robots
Registers a new automation rule in Bitrix24. Fields are passed flat at the JSON root — without a fields wrapper.
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
Fieldcode |
Typestring | Requiredyes | DescriptionUnique automation rule code. Allowed characters: a-z, A-Z, 0-9, ., -, _. Becomes the automation rule identifier in update and delete paths |
Fieldname |
Typestring | object | Requiredyes | DescriptionAutomation rule name. A string or a localized object like {"en": "...", "de": "..."} |
Fieldhandler |
Typestring | Requiredyes | DescriptionHandler URL. The domain must match the application domain |
FielddocumentType |
Typearray | Requiredno | DescriptionDocument type [module, object, type]. Values:["crm", "CCrmDocumentLead", "LEAD"] — leads["crm", "CCrmDocumentDeal", "DEAL"] — deals["crm", "Bitrix\\Crm\\Integration\\BizProc\\Document\\Quote", "QUOTE"] — quotes["crm", "Bitrix\\Crm\\Integration\\BizProc\\Document\\SmartInvoice", "SMART_INVOICE"] — invoices["crm", "Bitrix\\Crm\\Integration\\BizProc\\Document\\Dynamic", "DYNAMIC_<entityTypeId>"] — smart processes, <entityTypeId> from the entityTypeId field in GET /v1/smart-processes |
Fielddescription |
Typestring | object | Requiredno | DescriptionAutomation rule description. A string or a localized object |
FieldauthUserId |
Typenumber | Requiredno | DescriptionThe user whose token is passed to the application when the automation rule is invoked. List: GET /v1/users |
FielduseSubscription |
Typestring | Requiredno | DescriptionWhether to wait for a response from the application before continuing the rule: Y or N |
Fieldproperties |
Typeobject | Requiredno | DescriptionAutomation rule input parameters — the fields filled in when configuring the rule |
FieldreturnProperties |
Typeobject | Requiredno | DescriptionAutomation rule output parameters — the values the rule returns |
Fieldfilter |
Typeobject | Requiredno | DescriptionLimits which documents the automation rule is available for. Without the field, the automation rule is available for all documents.INCLUDE lists the conditions under which the automation rule is available, EXCLUDE those under which it is not. A condition is a document type prefix, for example ["crm", "CCrmDocumentDeal"], or a Bitrix24 edition: "b24" for cloud, "box" for on-premise.Example: {"INCLUDE": [["crm", "CCrmDocumentDeal"], ["crm", "CCrmDocumentLead"]]}.Write the keys in uppercase: with lowercase keys the field is accepted but restricts nothing. A value that is not an object returns 422 BITRIX_ERROR |
FieldusePlacement |
Typestring | Requiredno | DescriptionWhether to open the automation rule settings in a slider panel: Y or N |
FieldplacementHandler |
Typestring | Requiredno | DescriptionURL of the settings slider panel. Required when usePlacement: "Y" |
Examples
Only an OAuth application key can register an automation rule — both examples send an OAuth application key and the Authorization: Bearer header. The session token is issued by OAuth authorization, is valid for 24 hours, and cannot be renewed — Passing the key.
curl — OAuth application
curl -X POST "https://vibecode.bitrix24.com/v1/bizproc-robots" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"code": "deal_notify",
"name": { "en": "Deal notification", "de": "Deal-Benachrichtigung" },
"handler": "https://app.example.com/robots/deal-notify",
"documentType": ["crm", "CCrmDocumentDeal", "DEAL"],
"useSubscription": "N"
}'
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/bizproc-robots', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
code: 'deal_notify',
name: { en: 'Deal notification', de: 'Deal-Benachrichtigung' },
handler: 'https://app.example.com/robots/deal-notify',
documentType: ['crm', 'CCrmDocumentDeal', 'DEAL'],
useSubscription: 'N',
}),
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata.id |
Typestring | DescriptionAddressable identifier. Uses the code returned by Bitrix24 when present; otherwise equals the submitted code. Used as :code for PATCH and DELETE |
Response example
{
"success": true,
"data": {
"id": "deal_notify"
}
}
Error response example
403 — the request was sent with an API key:
{
"success": false,
"error": {
"code": "OAUTH_REQUIRED",
"message": "bizproc-robots require an OAuth app key (vibe_app_*) with an Authorization: Bearer session — a personal vibe_api_* key lacks the per-user OAuth context Bitrix24 needs for these methods. Create an OAuth app (POST /v1/apps) and retry with its key. On this 403 switch keys — do NOT delete or recreate the app (that discards anything already registered under it, e.g. a bizproc robot you just registered)."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP403 | CodeOAUTH_REQUIRED |
DescriptionThe request was sent with an API key. Only an authorization key can register automation rules |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe authorization key was sent without the Authorization: Bearer header |
| HTTP401 | CodeWRONG_AUTH_SCHEME |
DescriptionThe authorization key was sent in the Authorization: Bearer header. The key goes in X-Api-Key, while Authorization: Bearer carries the session token |
| HTTP401 | CodeINVALID_SESSION |
DescriptionThe session token has expired or is invalid — authorize again |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key lacks the bizproc scope |
| HTTP400 | CodeMISSING_REQUIRED_FIELDS |
DescriptionA required field is missing — code, name, or handler |
| HTTP400 | CodeSERVER_APP_MISMATCH |
Descriptionhandler points to a Black Hole subdomain that has no server of this app behind it — the subdomain does not exist, or the server belongs to another app. Register the handler with the key of the app the server is linked to |
| HTTP409 | CodeBIZPROC_MODULE_NOT_ENABLED |
DescriptionBusiness Processes are not available on the account: the module is not included in the plan, or it is switched off in account settings. Ask an account administrator to enable Business Processes — until then the method answers the same way for any number of retries |
| HTTP503 | CodeBIZPROC_CALLBACK_RESOLVE_FAILED |
DescriptionThe platform could not match the handler to a server. The automation rule is not registered — repeat the request |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 validation error — text in error.message |
The full list of common API errors — Errors.
Known specifics
A handler on a Black Hole subdomain gets reliable delivery. The platform takes over delivery of the calls and stores the address of its own receiver in Bitrix24 instead of the one you passed. Such a handler can only be registered with a single request, and the delivery itself is switched on per Bitrix24 account — Activity and automation rule callback delivery.