[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fbizproc-templates\u002Fsearch":3,"docs-tabs-entities\u002Fbizproc-templates\u002Fsearch":6},{"content":4,"lastmod":5},"\n## Template search\n\n`POST \u002Fv1\u002Fbizproc-templates\u002Fsearch`\n\nSelects business process templates that match the specified conditions and returns them as a list. Unlike the template list, this method takes the selection conditions in the request body, so a complex filter does not have to fit into the query string.\n\n## Request fields (body)\n\n| Field | Type | Default | Description |\n|------|-----|-----------|---------|\n| `filter` | object | — | Filtering by the fields of [`GET \u002Fv1\u002Fbizproc-templates\u002Ffields`](.\u002Ffields.md).\u003Cbr>[Filtering syntax](\u002Fdocs\u002Ffiltering). Example: `{ \"entity\": \"CCrmDocumentLead\" }`.\u003Cbr>The values of `moduleId` and `entity` are the first two elements of `documentType`, listed in [Upload a template](.\u002Fcreate.md) |\n| `select` | string[] | — | Fields in the response: `id`, `moduleId`, `entity`, `documentType`, `autoExecute`, `name`, `description`, `modified`, `isModified`, `userId`. Without `select`, the full declared field set is returned |\n| `order` | object | — | Sorting. Example: `{ \"id\": \"desc\" }` |\n| `limit` | number | `50` | Number of records in the response, up to 5000. Zero does not mean \"no limit\" — it is ignored. The response contains 50 records and the `LIMIT_ZERO_IGNORED` warning |\n| `offset` | number | `0` | Offset from the start of the selection |\n| `autoWindow` | boolean | `true` | Split the selection into weekly windows when the filter covers a `modified` range wider than 14 days. `false` disables the split |\n\n## Examples\n\nTemplates can be searched only with an authorization key — 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](\u002Fdocs\u002Fkeys-auth#passing-the-key).\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fbizproc-templates\u002Fsearch\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"filter\": { \"moduleId\": \"crm\" },\n    \"select\": [\"id\", \"name\", \"entity\", \"autoExecute\"],\n    \"order\": { \"id\": \"desc\" },\n    \"limit\": 3\n  }'\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fbizproc-templates\u002Fsearch', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    filter: { moduleId: 'crm' },\n    select: ['id', 'name', 'entity', 'autoExecute'],\n    order: { id: 'desc' },\n    limit: 3,\n  }),\n})\n\nconst { success, data, meta } = await res.json()\nconsole.log(`Templates found: ${meta.total}`)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data` | array | Array of templates. The fields of each element are defined by `select`. For the full schema, see [Template fields](.\u002Ffields.md). The `templateData` template file is not returned in responses |\n| `meta.total` | number | Number of templates matching the filter |\n| `meta.hasMore` | boolean | Whether there are records beyond `limit` |\n| `meta.durationMs` | number | Request duration in milliseconds |\n| `meta.warnings` | array | Warnings about how the request was parsed. Each one is an object with the `code`, `field`, and `message` fields, for example an unknown field name in `select` with the `UNKNOWN_SELECT_FIELD` code |\n| `meta.autoWindowed` | boolean | `true` if the selection was split into time windows |\n| `meta.windowCount` | number | Number of windows the date range was split into. Returned when `autoWindowed` is `true` |\n| `meta.batchWaves` | number | Number of parallel request waves used when splitting into windows |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": [\n    {\n      \"id\": 1237,\n      \"name\": \"Contract approval\",\n      \"entity\": \"CCrmDocumentDeal\",\n      \"autoExecute\": 1\n    },\n    {\n      \"id\": 1153,\n      \"name\": \"Purchase request\",\n      \"entity\": \"CCrmDocumentDeal\",\n      \"autoExecute\": 0\n    },\n    {\n      \"id\": 1143,\n      \"name\": \"Inquiry processing\",\n      \"entity\": \"CCrmDocumentLead\",\n      \"autoExecute\": 0\n    }\n  ],\n  \"meta\": {\n    \"total\": 18,\n    \"hasMore\": true,\n    \"durationMs\": 113\n  }\n}\n```\n\n## Error response example\n\n403 — the request was sent with an API key:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"OAUTH_REQUIRED\",\n    \"message\": \"bizproc-templates 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 \u002Fv1\u002Fapps) 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).\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_FILTER_OPERATOR` | An unknown operator in the filter. The message lists the supported operators |\n| 400 | `INVALID_FILTER_OPERATOR` | A logical key `$or` or `$and` in the filter. An OR condition is expressed with the `$in` operator for one field or with parallel requests through [`POST \u002Fv1\u002Fbatch`](\u002Fdocs\u002Fbatch), an AND condition with sibling keys of one filter |\n| 400 | `UNSTABLE_OFFSET_PAGINATION` | `offset` greater than zero together with a date-range filter wider than 14 days. Two different retrieval algorithms produce inconsistent results, so the request is rejected. Fetch everything in a single request with `limit` up to 5000, or pass `autoWindow: false` with sorting by `id`, or split the date range into parts yourself |\n| 403 | `OAUTH_REQUIRED` | The request was sent with an API key. Templates can be searched only with an authorization key |\n| 401 | `TOKEN_MISSING` | Authorization key without the `Authorization: Bearer` header |\n| 401 | `WRONG_AUTH_SCHEME` | The authorization key was sent in the `Authorization: Bearer` header. The key goes in `X-Api-Key`, while `Authorization: Bearer` carries the session token |\n| 401 | `INVALID_SESSION` | The session token has expired or is invalid — authorize again |\n| 403 | `SCOPE_DENIED` | The key lacks the `bizproc` scope |\n| 409 | `BIZPROC_MODULE_NOT_ENABLED` | Business 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, retrying returns the same error |\n| 429 | `RATE_LIMITED` | Rate limit exceeded: 300 requests per minute per portal. All API keys of the portal share one limit. The current limit is returned in the `x-ratelimit-limit` header. Retry after the delay in the `Retry-After` header |\n\nFor the full list of common API errors, see [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**The identifier must be listed in `select` explicitly.** `id` is not added to the selected fields — if it is needed for a later update or delete, include it in `select` yourself.\n\n**When the selection is split into windows, `meta.total` counts only the windows that were read.** A `modified` range filter wider than 14 days reads the selection in weekly windows and stops once it has collected `limit` records: `meta.total` then carries the count from the windows already read, which is lower than the full count. The exact count comes from a request with `autoWindow: false` or from reading the whole selection in one request with `limit` up to 5000.\n\n**An unknown field name does not interrupt the request.** In `filter` the result set is not narrowed, in `order` the sort order does not change, in `select` the field is absent from the records, and a warning with the `UNKNOWN_SELECT_FIELD` code is returned in `meta.warnings`. Check field names against the schema at [`GET \u002Fv1\u002Fbizproc-templates\u002Ffields`](.\u002Ffields.md).\n\n## See also\n\n- [Template list](\u002Fdocs\u002Fentities\u002Fbizproc-templates\u002Flist)\n- [Template fields](\u002Fdocs\u002Fentities\u002Fbizproc-templates\u002Ffields)\n- [Upload a template](\u002Fdocs\u002Fentities\u002Fbizproc-templates\u002Fcreate)\n- [Filtering syntax](\u002Fdocs\u002Ffiltering)\n- [Keys and authorization](\u002Fdocs\u002Fkeys-auth)\n","2026-10-23",{},1794739314433]