[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Ftasks\u002Fflows-delete":3,"docs-tabs-entities\u002Ftasks\u002Fflows-delete":6},{"content":4,"lastmod":5},"## Delete a flow\n\n`DELETE \u002Fv1\u002Ftasks\u002Fflows\u002F:flowId`\n\nDeletes a task flow by its ID.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `flowId` (path) | number | yes | Flow ID, a positive integer. List: [`GET \u002Fv1\u002Ftasks\u002Fflows`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-list) |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X DELETE \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002Fflows\u002F20\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X DELETE \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002Fflows\u002F20\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002Fflows\u002F20', {\n  method: 'DELETE',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { success, data } = await res.json()\nif (success && data.deleted) {\n  console.log('Flow deleted')\n}\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002Fflows\u002F20', {\n  method: 'DELETE',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data } = await res.json()\nif (success && data.deleted) {\n  console.log('Flow deleted')\n}\n```\n\n## Response fields\n\nA successful deletion returns `200` with a body, not `204 No Content`.\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | `true` on success |\n| `data.deleted` | boolean | `true` — the flow is deleted |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"deleted\": true\n  }\n}\n```\n\n## Error response example\n\n422 — no flow with this `flowId` exists, or it is already deleted:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"Unknown error. [Flow: 312]\",\n    \"b24Code\": \"0\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | `flowId` is not a positive integer. Message: `flowId must be a positive safe integer` |\n| 400 | `FST_ERR_CTP_EMPTY_JSON_BODY` | The `Content-Type: application\u002Fjson` header is sent with an empty body. Remove the header |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `INVALID_API_KEY` | The key is not found |\n| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens |\n| 403 | `SCOPE_DENIED` | The key has neither the `task` nor the `tasks` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode. `error.details.switchUrl` holds the address of the section where the mode is changed |\n| 422 | `BITRIX_ERROR` | No flow with this `flowId` exists, including on a repeated deletion. The message looks like `Unknown error. [Flow: 312]`; there is no `404` response in this case |\n| 429 | `RATE_LIMITED` | The request rate to Bitrix24 or to the platform is exceeded. Retry after the delay in the `Retry-After` header |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unreachable or returned a server error |\n| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not respond in time |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**The flow's workgroup stays.** Deletion does not touch the group the flow was bound to, including a group created together with the flow. While the group exists, a new flow with the same name cannot be created without `groupId` — the response is `422` with the message `A group with this name already exists`. To delete the group as well, save the `groupId` from [`GET \u002Fv1\u002Ftasks\u002Fflows\u002F:flowId`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-get) before deleting the flow and call [`DELETE \u002Fv1\u002Fworkgroups\u002F:id`](\u002Fdocs\u002Fentities\u002Fworkgroups\u002Fdelete).\n\n**Disabling instead of deleting.** To stop a flow and keep its settings, disable it: [`POST \u002Fv1\u002Ftasks\u002Fflows\u002F:flowId\u002Factivate`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-activate) switches an enabled flow to disabled.\n\n## See also\n\n- [Flows and flow tasks](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows)\n- [List flows](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-list)\n- [Get a flow](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-get)\n- [Create a flow](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-create)\n- [Toggle flow activity](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-activate)\n- [Workgroups](\u002Fdocs\u002Fentities\u002Fworkgroups)\n","2026-10-20",{},1795415315497]