[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Ftasks\u002Fflows-create":3,"docs-tabs-entities\u002Ftasks\u002Fflows-create":6},{"content":4,"lastmod":5},"## Create a flow\n\n`POST \u002Fv1\u002Ftasks\u002Fflows`\n\nCreates a task flow — a shared queue from which tasks go to the responsible employees. Flow fields are passed in the `flowData` object and sent to Bitrix24 unchanged.\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `flowData` | object | yes | Flow fields |\n| `flowData.name` | string | yes | Flow name. You cannot create two flows with the same name in one Bitrix24 account |\n| `flowData.plannedCompletionTime` | number | yes | Time to complete a task, in seconds, for example `86400` — one day |\n| `flowData.distributionType` | string | yes | How tasks reach assignees: `manually` — a moderator assigns them, `queue` — in turn among the employees in `responsibleList`, `himself` — employees take tasks themselves |\n| `flowData.responsibleList` | array | yes | Who receives the tasks: an array of pairs like `[\"user\", \"3\"]`, where the second element is the employee ID as a string. With `manually`, the list holds the flow moderator. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `flowData.groupId` | number | no | ID of the workgroup the flow is bound to. List: [`GET \u002Fv1\u002Fworkgroups`](\u002Fdocs\u002Fentities\u002Fworkgroups\u002Flist). If the field is not passed, a new group named after the flow is created |\n| `flowData.ownerId` | number | no | Flow administrator ID. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist). If the field is not passed, the employee on whose behalf the request is made becomes the administrator |\n| `flowData.description` | string | no | Flow description. Defaults to an empty string |\n| `flowData.taskCreators` | array | no | Who can submit tasks to the flow: an array of pairs. `[[\"meta-user\", \"all-users\"]]` — all employees |\n| `flowData.matchWorkTime` | number | no | `1` — weekends and holidays are skipped when the deadline is calculated, `0` — they are counted. Defaults to `1` |\n| `flowData.responsibleCanChangeDeadline` | number | no | `1` — the assignee can change the task deadline, `0` — cannot. Defaults to `1` |\n| `flowData.taskControl` | number | no | `1` — a completed task goes to its creator for review, `0` — no review. Defaults to `0` |\n| `flowData.notifyAtHalfTime` | number | no | `1` — remind the assignee halfway to the deadline, `0` — no reminder. Defaults to `0` |\n| `flowData.notifyOnQueueOverflow` | number | no | Notify the flow administrator when the number of tasks in the queue exceeds this value. Defaults to `null` — no notification |\n| `flowData.notifyOnTasksInProgressOverflow` | number | no | Notify the flow administrator when the number of tasks in progress exceeds this value. Defaults to `null` — no notification |\n| `flowData.notifyWhenEfficiencyDecreases` | number | no | Notify the flow administrator when efficiency drops below this value, in percent. Defaults to `null` — no notification |\n| `analyticsParams` | object | no | Internal Bitrix24 analytics tags. They do not affect the flow |\n\nThe body must not contain keys other than `flowData` and `analyticsParams`. The `matchWorkTime`, `responsibleCanChangeDeadline`, `taskControl`, and `notifyAtHalfTime` flags are passed as the numbers `1` and `0` and come back in the response as `true` and `false`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002Fflows\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"flowData\": {\n      \"name\": \"Request processing\",\n      \"description\": \"Customer requests from the website\",\n      \"plannedCompletionTime\": 86400,\n      \"distributionType\": \"queue\",\n      \"responsibleList\": [[\"user\", \"3\"]]\n    }\n  }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002Fflows\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"flowData\": {\n      \"name\": \"Request processing\",\n      \"description\": \"Customer requests from the website\",\n      \"plannedCompletionTime\": 86400,\n      \"distributionType\": \"queue\",\n      \"responsibleList\": [[\"user\", \"3\"]]\n    }\n  }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002Fflows', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    flowData: {\n      name: 'Request processing',\n      description: 'Customer requests from the website',\n      plannedCompletionTime: 86400,\n      distributionType: 'queue',\n      responsibleList: [['user', '3']],\n    },\n  }),\n})\n\nconst { success, data } = await res.json()\nif (success) {\n  console.log('Flow ID:', data.id, 'Group ID:', data.groupId)\n}\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002Fflows', {\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    flowData: {\n      name: 'Request processing',\n      description: 'Customer requests from the website',\n      plannedCompletionTime: 86400,\n      distributionType: 'queue',\n      responsibleList: [['user', '3']],\n    },\n  }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | `true` on success |\n| `data` | object | The created flow. The set of fields is the same as in the [`GET \u002Fv1\u002Ftasks\u002Fflows\u002F:flowId`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-get) response |\n| `data.id` | number | ID of the new flow |\n| `data.creatorId` | number | ID of the employee on whose behalf the request was made |\n| `data.ownerId` | number | Flow administrator ID |\n| `data.groupId` | number | ID of the flow's workgroup. If the request had no `groupId`, the ID of the created group |\n| `data.active` | boolean | `true` — the flow is enabled. A new flow is created enabled |\n| `data.efficiency` | number | Flow efficiency in percent. For a new flow — `100` |\n| `data.activity` | string | Date and time of the flow's activity in ISO 8601 format. For a new flow — the moment of creation |\n| `data.taskCreators` | array | An empty array, even if `taskCreators` was passed in the request. The saved value is returned by [`GET \u002Fv1\u002Ftasks\u002Fflows\u002F:flowId`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-get) |\n| `data.team` | array | An empty array. The flow team is returned by [`GET \u002Fv1\u002Ftasks\u002Fflows\u002F:flowId`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-get) |\n\nFields from the request come back with the passed values; fields that were not passed come back with the defaults from the request fields table.\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 20,\n    \"creatorId\": 1,\n    \"ownerId\": 1,\n    \"groupId\": 178,\n    \"templateId\": 0,\n    \"efficiency\": 100,\n    \"active\": true,\n    \"plannedCompletionTime\": 86400,\n    \"activity\": \"2026-10-20T00:23:04+00:00\",\n    \"name\": \"Request processing\",\n    \"description\": \"Customer requests from the website\",\n    \"distributionType\": \"queue\",\n    \"responsibleList\": [\n      [\"user\", \"3\"]\n    ],\n    \"demo\": false,\n    \"responsibleCanChangeDeadline\": true,\n    \"matchWorkTime\": true,\n    \"matchSchedule\": false,\n    \"taskControl\": false,\n    \"notifyAtHalfTime\": false,\n    \"notifyOnQueueOverflow\": null,\n    \"notifyOnTasksInProgressOverflow\": null,\n    \"notifyWhenEfficiencyDecreases\": null,\n    \"taskCreators\": [],\n    \"team\": [],\n    \"trialFeatureEnabled\": false\n  }\n}\n```\n\n## Error response example\n\n422 — the required `distributionType` field is not passed:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"Property distributionType cannot be null\",\n    \"b24Code\": \"0\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | The body is not an object or contains keys other than `flowData` and `analyticsParams`. Message: `body must be an object with supported fields only` |\n| 400 | `INVALID_PARAMS` | `flowData` is not passed or is not an object. Message: `flowData must be an object` |\n| 400 | `INVALID_PARAMS` | `analyticsParams` is not an object. Message: `analyticsParams must be an object` |\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` | A required field is not passed. Messages: `Property name cannot be null`, `Property plannedCompletionTime cannot be null`, `Property distributionType cannot be null`, `'responsibleList': field's value must not be empty` |\n| 422 | `BITRIX_ERROR` | `distributionType` is not one of `manually`, `queue`, `himself`. Message: `distributionType: unexpected value` |\n| 422 | `BITRIX_ERROR` | `groupId` is not passed, and a group with the same name as the flow already exists on the portal, including one left over from a deleted flow. Message: `A group with this name already exists`, `error.b24Code` is `ERROR_GROUP_NAME_EXISTS` |\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**Creation is not retried automatically.** The `502 BITRIX_UNAVAILABLE` and `503 BITRIX_TIMEOUT` responses do not tell whether the flow was created, and the platform does not retry such a request on its own. Before sending it again, look for the flow by name in [`GET \u002Fv1\u002Ftasks\u002Fflows`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-list).\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- [Update a flow](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-update)\n- [Toggle flow activity](\u002Fdocs\u002Fentities\u002Ftasks\u002Fflows-activate)\n- [Employees](\u002Fdocs\u002Fentities\u002Fusers)\n- [Workgroups](\u002Fdocs\u002Fentities\u002Fworkgroups)\n","2026-10-20",{},1794739434313]