For AI agents: markdown of this page — /docs-content-en/entities/tasks/flows-delete.md documentation index — /llms.txt
Delete a flow
DELETE /v1/tasks/flows/:flowId
Deletes a task flow by its ID.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ParameterflowId (path) |
Typenumber | Requiredyes | DescriptionFlow ID, a positive integer. List: GET /v1/tasks/flows |
Examples
curl — personal key
curl -X DELETE "https://vibecode.bitrix24.com/v1/tasks/flows/20" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl -X DELETE "https://vibecode.bitrix24.com/v1/tasks/flows/20" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/tasks/flows/20', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
const { success, data } = await res.json()
if (success && data.deleted) {
console.log('Flow deleted')
}
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/tasks/flows/20', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const { success, data } = await res.json()
if (success && data.deleted) {
console.log('Flow deleted')
}
Response fields
A successful deletion returns 200 with a body, not 204 No Content.
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | Descriptiontrue on success |
Fielddata.deleted |
Typeboolean | Descriptiontrue — the flow is deleted |
Response example
{
"success": true,
"data": {
"deleted": true
}
}
Error response example
422 — no flow with this flowId exists, or it is already deleted:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "Unknown error. [Flow: 312]",
"b24Code": "0"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
DescriptionflowId is not a positive integer. Message: flowId must be a positive safe integer |
| HTTP400 | CodeFST_ERR_CTP_EMPTY_JSON_BODY |
DescriptionThe Content-Type: application/json header is sent with an empty body. Remove the header |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionThe X-Api-Key header is missing |
| HTTP401 | CodeINVALID_API_KEY |
DescriptionThe key is not found |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe key has no Bitrix24 tokens |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key has neither the task nor the tasks scope |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe key is in read-only mode. error.details.switchUrl holds the address of the section where the mode is changed |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionNo 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 |
| HTTP429 | CodeRATE_LIMITED |
DescriptionThe request rate to Bitrix24 or to the platform is exceeded. Retry after the delay in the Retry-After header |
| HTTP502 | CodeBITRIX_UNAVAILABLE |
DescriptionBitrix24 is unreachable or returned a server error |
| HTTP503 | CodeBITRIX_TIMEOUT |
DescriptionBitrix24 did not respond in time |
Full list of common API errors — Errors.
Known specifics
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 /v1/tasks/flows/:flowId before deleting the flow and call DELETE /v1/workgroups/:id.
Disabling instead of deleting. To stop a flow and keep its settings, disable it: POST /v1/tasks/flows/:flowId/activate switches an enabled flow to disabled.