For AI agents: markdown of this page — /docs-content-en/entities/bizproc-templates/update.md documentation index — /llms.txt
Update a template
PATCH /v1/bizproc-templates/:id
Updates a business process template uploaded by the same application. Fields are passed flat at the JSON root — without a fields wrapper.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionTemplate identifier. Source: GET /v1/bizproc-templates |
Request fields (body)
Four fields can be changed. The remaining fields of the record are set when the file is uploaded and are not affected by an update request.
| Field | Type | Description |
|---|---|---|
Fieldname |
Typestring | DescriptionTemplate name |
Fielddescription |
Typestring | DescriptionTemplate description |
FieldautoExecute |
Typenumber | DescriptionAutostart condition: 0 — no autostart, 1 — on document creation, 2 — on change, 3 — on creation and change |
FieldtemplateData |
Typearray | DescriptionNew template file as two elements — the file name and its contents in base64 |
Examples
Only an authorization key can update templates — both examples send the authorization 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 PATCH "https://vibecode.bitrix24.com/v1/bizproc-templates/1215" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Deal approval — version 2",
"autoExecute": 1
}'
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/bizproc-templates/1215', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Deal approval — version 2',
autoExecute: 1,
}),
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata.id |
Typenumber | DescriptionIdentifier of the updated template |
Response example
{
"success": true,
"data": {
"id": 1215
}
}
Error response example
422 — the template was uploaded by another application or created in the Bitrix24 business process designer:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "You can update ONLY templates created by current application"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 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 |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionThe template was uploaded by another application — message You can update ONLY templates created by current application |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionNo template with the given id — message Workflow template not found., the b24Code field contains ERROR_TEMPLATE_NOT_FOUND |
| HTTP400 | CodeEMPTY_UPDATE_BODY |
DescriptionThe request body is empty — pass at least one field |
| HTTP400 | CodeREADONLY_FIELD |
DescriptionA read-only field was passed in the body, for example id |
| HTTP403 | CodeOAUTH_REQUIRED |
DescriptionThe request was sent with an API key. Only an authorization key can update templates |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionAuthorization key 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 |
When the error comes from Bitrix24, the error object also includes a b24Code field — the machine-readable reason code.
The full list of common API errors — Errors.
Known specifics
Only your own templates can be updated. You can change a template uploaded by the same application whose authorization key is used to send the request. An update to a template created in the Bitrix24 business process designer or uploaded by another application returns 422, and the template remains unchanged.
documentType cannot be changed after upload. The schema at GET /v1/bizproc-templates/fields marks the field as readonly: false, but an update request applies only the four fields from the table above — the document type is set when the file is uploaded. A request carrying documentType returns 200 and leaves the value unchanged.
A field name outside the list above does not raise an error. The request returns 200, and the value is not applied. Check the result by reading the record through GET /v1/bizproc-templates filtered by id.
Replacing the file marks the template as changed. After templateData is updated, the isModified field in the list response becomes true.