[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Ftasks\u002Fflows-activate":3,"docs-tabs-entities\u002Ftasks\u002Fflows-activate":6},{"content":4,"lastmod":5},"## Toggle flow activity\n\n`POST \u002Fv1\u002Ftasks\u002Fflows\u002F:flowId\u002Factivate`\n\nTurns an inactive flow on and an active flow off: each call switches the flow to the opposite state.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `flowId` (path) | number | yes | Flow ID. List: [`GET \u002Fv1\u002Ftasks\u002Fflows`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-list) |\n\nNo request body is required; fields in the body are ignored.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST 'https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002Fflows\u002F20\u002Factivate' \\\n  -H 'X-Api-Key: YOUR_API_KEY'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST 'https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002Fflows\u002F20\u002Factivate' \\\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 response = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002Fflows\u002F20\u002Factivate', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\nconst result = await response.json()\nconsole.log(result.data)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst response = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002Fflows\u002F20\u002Factivate', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\nconst result = await response.json()\nconsole.log(result.data)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | `true` on success |\n| `data` | boolean | `true` — the flow was toggled. The response is the same whether the flow was turned on or off. Read the new state from the `active` field in [`GET \u002Fv1\u002Ftasks\u002Fflows\u002F:flowId`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-get) |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": true\n}\n```\n\n## Error response example\n\n422 — no flow with this ID exists:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"Flow with this ID does not exist.\",\n    \"b24Code\": \"0\"\n  }\n}\n```\n\nThe `error.message` text comes in the Bitrix24 account language.\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | `flowId` is not a positive integer: `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: `Flow with this ID does not exist.` |\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 toggle is not retried automatically.** The `503 BITRIX_TIMEOUT` and `502 BITRIX_UNAVAILABLE` responses do not tell whether the flow was toggled, and the platform does not retry such a call on its own: a retry would return the flow to its previous state. Before calling the method again, read the `active` field in [`GET \u002Fv1\u002Ftasks\u002Fflows\u002F:flowId`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-get).\n\n## See also\n\n- [Flows and flow tasks](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows)\n- [Get a flow](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-get)\n- [List flows](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-list)\n- [Update a flow](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-update)\n- [Tasks](\u002Fdocs\u002Fentities\u002Ftasks)\n","2026-10-20",{},1794739434075]