{"record":{"id":"3d6eb04f4ac99040","repo":"FlowiseAI/Flowise","slug":"error-chatflowscontroller-clearwebhooksecret-id","errorCode":null,"errorMessage":"Error: chatflowsController.clearWebhookSecret - id not provided!","messagePattern":"Error: chatflowsController\\.clearWebhookSecret - id not provided!","errorType":"exception","errorClass":"InternalFlowiseError","httpStatus":412,"severity":"error","filePath":"packages/server/src/controllers/chatflows/index.ts","lineNumber":324,"sourceCode":"                StatusCodes.PRECONDITION_FAILED,\n                `Error: chatflowsController.setWebhookSecret - id not provided!`\n            )\n        }\n        const workspaceId = req.user?.activeWorkspaceId\n        if (!workspaceId) {\n            throw new InternalFlowiseError(StatusCodes.UNAUTHORIZED, `Error: chatflowsController.setWebhookSecret - workspace not found!`)\n        }\n        const apiResponse = await chatflowsService.setWebhookSecret(req.params.id, workspaceId)\n        return res.json(apiResponse)\n    } catch (error) {\n        next(error)\n    }\n}\n\nconst clearWebhookSecret = async (req: Request, res: Response, next: NextFunction) => {\n    try {\n        if (!req.params.id) {\n            throw new InternalFlowiseError(\n                StatusCodes.PRECONDITION_FAILED,\n                `Error: chatflowsController.clearWebhookSecret - id not provided!`\n            )\n        }\n        const workspaceId = req.user?.activeWorkspaceId\n        if (!workspaceId) {\n            throw new InternalFlowiseError(StatusCodes.UNAUTHORIZED, `Error: chatflowsController.clearWebhookSecret - workspace not found!`)\n        }\n        await chatflowsService.clearWebhookSecret(req.params.id, workspaceId)\n        return res.sendStatus(StatusCodes.NO_CONTENT)\n    } catch (error) {\n        next(error)\n    }\n}\n\nconst getScheduleStatus = async (req: Request, res: Response, next: NextFunction) => {\n    try {\n        if (!req.params?.id) {","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/server/src/controllers/chatflows/index.ts#L306-L342","documentation":"Thrown by clearWebhookSecret when req.params.id is falsy. The endpoint removes a previously-set webhook secret for a specific chatflow; without an id the service cannot target the record. Returned as PRECONDITION_FAILED (412). Structurally identical to the setWebhookSecret id guard.","triggerScenarios":"A DELETE request to the clear-webhook-secret route with no :id in the path, or a route definition missing :id so the param is undefined.","commonSituations":"Client calls the endpoint before a chatflow id is selected, URL template left unfilled, or router mounted the handler on a bare path.","solutions":["Include the target chatflow id in the request path.","Guard the client call behind an id-presence check.","Confirm the route declares :id."],"exampleFix":"// before\nawait fetch(`/api/v1/chatflows//webhook-secret`, { method: 'DELETE' })\n// after\nawait fetch(`/api/v1/chatflows/${encodeURIComponent(chatflowId)}/webhook-secret`, { method: 'DELETE' })","handlingStrategy":"validation","validationCode":"function clearWebhookSecret(id: string) {\n  if (!id) throw new Error('chatflow id required before clearing webhook secret')\n  return fetch(`/api/v1/chatflows/${encodeURIComponent(id)}/webhook-secret`, { method: 'DELETE' })\n}","typeGuard":"const isNonEmptyString = (v: unknown): v is string => typeof v === 'string' && v.trim().length > 0","tryCatchPattern":"try { await clearWebhookSecret(id) } catch (e) { if (e.statusCode === 412) throw new Error('provide a chatflow id') }","preventionTips":["Bind the clear action to a selected chatflow.","Validate id presence client-side.","Confirm the route declares :id."],"tags":["flowise","controller","validation","precondition-failed","path-param","webhook","typescript"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}