
# Business process templates

A business process template is a process blueprint bound to a document type: a deal, a lead, a list item, a Drive document. Bitrix24 starts a process from the template when the document is created or changed. An application uploads a ready-made template as a `.bpt` file, changes its settings, and deletes it.

Templates can be read, uploaded, 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 templates.

Bitrix24 API: `bizproc.workflow.template.*`
Scope: `bizproc`

## Operations

- [Upload a template](./bizproc-templates/create.md) — `POST /v1/bizproc-templates`
- [Template list](./bizproc-templates/list.md) — `GET /v1/bizproc-templates`
- [Update a template](./bizproc-templates/update.md) — `PATCH /v1/bizproc-templates/:id`
- [Delete a template](./bizproc-templates/delete.md) — `DELETE /v1/bizproc-templates/:id`
- [Template fields](./bizproc-templates/fields.md) — `GET /v1/bizproc-templates/fields`

## Key fields

| Field | Type | Description |
|------|-----|---------|
| `id` | number | Template identifier. Used in the update and delete paths |
| `name` | string | Template name |
| `documentType` | array | Document type as three elements — module, object, type. Set on upload |
| `templateData` | array | Template file — file name and base64 content. Passed on upload and update, never returned in responses |
| `autoExecute` | number | Auto-start condition: `0` — no auto-start, `1` — on document creation, `2` — on change, `3` — on creation and change |
| `isModified` | boolean | Whether the template was edited after the file was uploaded |
| `userId` | number | Author of the last change. List: `GET /v1/users` |

## What to know before you start

1. **An authorization key `vibe_app_…` is required, not an API key `vibe_api_…`.** All five operations require an application context. An API key returns `403 OAUTH_REQUIRED`. Send the authorization key together with the `Authorization: Bearer` header — see [Keys and authorization](/docs/keys-auth). The session token is issued by OAuth authorization, is valid for 24 hours, and cannot be renewed — after it expires, calls return `401 INVALID_SESSION` and you have to authorize again. How to obtain and pass the token — [Passing the key](/docs/keys-auth#passing-the-key).
2. **Administrator only.** Only a user with Bitrix24 account administrator rights can manage templates. For everyone else Bitrix24 returns an access error.
3. **An application manages only its own templates.** You can update and delete a template uploaded by the same application. Templates from the Bitrix24 business process designer and from other applications appear in the list but return `422` on modification.
4. **A template is uploaded as a file.** The process is configured in the Bitrix24 business process designer and exported to a `.bpt` file whose content is passed in `templateData` in base64. A template cannot be assembled from fields through the API.
5. **Without `select` the list returns every declared field.** The full set (including `id`) comes back even without `select`; use the parameter only to narrow the response to specific fields.
6. **Fetching a single template is not supported.** The `get` operation is unavailable — read a record through the list with a filter by `id`.

## Related entities

| Entity | Endpoint | Purpose |
|----------|----------|-----------|
| Business process activities | [`/v1/bizproc-activities`](/docs/entities/bizproc-activities) | The application's own activities in the process designer |
| Automation rules | [`/v1/bizproc-robots`](/docs/entities/bizproc-robots) | Automation rules in the automation designer |
| Workflows | [`/v1/workflows`](/docs/automation/workflows) | Starting a process from a template, listing running processes, terminating |
| Smart processes | [`/v1/smart-processes`](/docs/entities/smart-processes) | Source of `entityTypeId` for a smart process document type |

## Typical scenario

1. Configure the process in the Bitrix24 business process designer and export it to a `.bpt` file.
2. Upload the file through [`POST /v1/bizproc-templates`](./bizproc-templates/create.md), specifying the document type and the auto-start condition. The response returns `id`.
3. Check the record through [`GET /v1/bizproc-templates`](./bizproc-templates/list.md) with a filter by `id` and the `select` you need.
4. Change the name, description, auto-start condition, or the file itself through [`PATCH /v1/bizproc-templates/:id`](./bizproc-templates/update.md).
5. Delete a template you no longer need through [`DELETE /v1/bizproc-templates/:id`](./bizproc-templates/delete.md).

## Limits

| Limit | Value |
|-------|----------|
| Maximum records per request | 5000 |
| Automatic pagination | enabled when `limit` is greater than 50 |
| Batch requests | up to 50 operations in [`POST /v1/batch`](/docs/batch) |
| Request rate | the shared Vibecode API limit — see [Limits and optimization](/docs/optimization) |

## See also

- [Business process activities](/docs/entities/bizproc-activities)
- [Automation rules](/docs/entities/bizproc-robots)
- [Workflows](/docs/automation/workflows)
- [Keys and authorization](/docs/keys-auth)
- [Entity reference](/docs/entities-index)
