[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-automation\u002Fbizproc-tasks\u002Fcomplete":3,"docs-tabs-automation\u002Fbizproc-tasks\u002Fcomplete":6},{"content":4,"lastmod":5},"# Complete a task\n\n`POST \u002Fv1\u002Fbizproc-tasks\u002F:id\u002Fcomplete`\n\nThis is a real approval, not a test run. `approve`, `reject`, `ok`, `cancel` are sent as 1, 2, 3, 4. Bitrix24 checks which decisions the task type allows. Re-read the list after a timeout: a retry may be refused because the task is already completed.\n\nBitrix24 API: `bizproc.task.complete`\nScope: `bizproc`\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|---|---|---|---|\n| `id` (path) | integer | yes | Positive task ID from the [task list](\u002Fdocs\u002Fautomation\u002Fbizproc-tasks\u002Flist) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|---|---|---|---|\n| `status` | string | yes | Decision: `approve`, `reject`, `ok` or `cancel` |\n| `comment` | string | no | Decision comment. Required when the task form demands one |\n| `fields` | object | no | Values keyed by field code from the task's `parameters.Fields[].Id` in the [task list](\u002Fdocs\u002Fautomation\u002Fbizproc-tasks\u002Flist). A file is `[name, base64]`. Request body limit: 1 MiB |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fbizproc-tasks\u002F42\u002Fcomplete\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"status\":\"approve\",\"comment\":\"VIBE-PROBE\"}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fbizproc-tasks\u002F42\u002Fcomplete\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"status\":\"approve\",\"comment\":\"VIBE-PROBE\"}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst response = await fetch(\"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fbizproc-tasks\u002F42\u002Fcomplete\", {\n  method: \"POST\",\n  headers: { \"X-Api-Key\": \"YOUR_API_KEY\", \"Content-Type\": \"application\u002Fjson\" },\n  body: JSON.stringify({\"status\":\"approve\",\"comment\":\"VIBE-PROBE\"})\n});\nconsole.log(await response.json());\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst response = await fetch(\"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fbizproc-tasks\u002F42\u002Fcomplete\", {\n  method: \"POST\",\n  headers: { \"X-Api-Key\": \"YOUR_APP_KEY\", \"Authorization\": \"Bearer USER_SESSION_TOKEN\", \"Content-Type\": \"application\u002Fjson\" },\n  body: JSON.stringify({\"status\":\"approve\",\"comment\":\"VIBE-PROBE\"})\n});\nconsole.log(await response.json());\n```\n\n## Response fields\n\n| Field | Type | Description |\n|---|---|---|\n| `success` | boolean | `true` |\n| `data` | boolean | `true`, only if Bitrix24 returned `true` |\n\n## Response example\n\n```json\n{\"success\":true,\"data\":true}\n```\n\n## Error response example\n\n404 — no task with this `id` among the current user's tasks:\n\n```json\n{\"success\":false,\"error\":{\"code\":\"ENTITY_NOT_FOUND\",\"message\":\"Task not found or inaccessible\"}}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|---|---|---|\n| 400 | `INVALID_PARAMS` | `id` is not a positive integer, `status` is not in the list, `comment` is not a string, `fields` is not an object, or the body contains other fields |\n| 401 | `TOKEN_MISSING` | No Bitrix24 credentials |\n| 403 | `SCOPE_DENIED` | Missing `bizproc` scope |\n| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denies access |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | Key blocks writes |\n| 404 | `ENTITY_NOT_FOUND` | Task not found for the current user |\n| 422 | `BITRIX_ERROR` | Bitrix24 business refusal. The message is preserved with secrets removed |\n| 502 | `BITRIX_RESPONSE_INVALID` | Unexpected response shape or action result |\n\nCommon refusals and limits: [API errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [Business-process tasks](\u002Fdocs\u002Fautomation\u002Fbizproc-tasks)\n- [List tasks](\u002Fdocs\u002Fautomation\u002Fbizproc-tasks\u002Flist)\n- [Workflows](\u002Fdocs\u002Fautomation\u002Fworkflows)\n","2026-10-20",{},1795343927611]