{"record":{"id":"b165112c3c010492","repo":"FlowiseAI/Flowise","slug":"error-apikeycontroller-verifyapikey-apikey-not","errorCode":null,"errorMessage":"Error: apikeyController.verifyApiKey - apikey not provided!","messagePattern":"Error: apikeyController\\.verifyApiKey - apikey not provided!","errorType":"validation","errorClass":"InternalFlowiseError","httpStatus":412,"severity":"warning","filePath":"packages/server/src/controllers/apikey/index.ts","lineNumber":96,"sourceCode":"    try {\n        if (typeof req.params === 'undefined' || !req.params.id) {\n            throw new InternalFlowiseError(StatusCodes.PRECONDITION_FAILED, `Error: apikeyController.deleteApiKey - id not provided!`)\n        }\n        if (!req.user?.activeWorkspaceId) {\n            throw new InternalFlowiseError(StatusCodes.PRECONDITION_FAILED, `Workspace ID is required`)\n        }\n        const apiResponse = await apikeyService.deleteApiKey(req.params.id, req.user?.activeWorkspaceId)\n        return res.json(apiResponse)\n    } catch (error) {\n        next(error)\n    }\n}\n\n// Verify api key\nconst verifyApiKey = async (req: Request, res: Response, next: NextFunction) => {\n    try {\n        if (typeof req.params === 'undefined' || !req.params.apikey) {\n            throw new InternalFlowiseError(StatusCodes.PRECONDITION_FAILED, `Error: apikeyController.verifyApiKey - apikey not provided!`)\n        }\n        const apiResponse = await apikeyService.verifyApiKey(req.params.apikey)\n        return res.json(apiResponse)\n    } catch (error) {\n        next(error)\n    }\n}\n\nexport default {\n    createApiKey,\n    deleteApiKey,\n    getAllApiKeys,\n    updateApiKey,\n    verifyApiKey\n}\n","sourceCodeStart":78,"sourceCodeEnd":112,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/server/src/controllers/apikey/index.ts#L78-L112","documentation":"Thrown by apikeyController.verifyApiKey with HTTP 412 when req.params is undefined or req.params.apikey is falsy. Unlike the other apikey handlers, verifyApiKey is NOT mounted under /apikey — it is registered in routes/verify/index.ts:6 as GET ['/apikey/', '/apikey/:apikey'] on the verify router, i.e. GET /api/v1/verify/apikey/<apikey>. So the path parameter expected is named apikey, not id.","triggerScenarios":"Calling GET /api/v1/verify/apikey/ (root form, no key segment). A client that hits the wrong base (e.g. /api/v1/apikey/verify/) gets a 404 from Express, not this error. A caller verifying a key before the user has entered it, building the URL from an empty variable.","commonSituations":"An SDK or browser extension that validates a pasted API key but runs the check while the input field is still empty. A smoke-test script that verifies a key read from an env var that was not set. Confusing this endpoint with a /apikey/verify path (it lives under /verify/apikey).","solutions":["Call GET /api/v1/verify/apikey/<apikey> with the literal key value in the final segment.","Guard the key client-side: skip the call when the key is empty/blank.","Use the correct path (/verify/apikey/:apikey), not /apikey/verify."],"exampleFix":"// before\nawait fetch(`${BASE}/api/v1/apikey/verify/`, { headers })\n\n// after\nif (!apikey) throw new Error('apikey required')\nawait fetch(`${BASE}/api/v1/verify/apikey/${encodeURIComponent(apikey)}`, { headers })","handlingStrategy":"validation","validationCode":"function assertApiKey(key: unknown): string {\n  if (typeof key !== 'string' || key.trim() === '') {\n    throw new Error('apikey is required for verification')\n  }\n  return key\n}\nconst key = assertApiKey(rawKey)\nawait fetch(`${BASE}/api/v1/verify/apikey/${encodeURIComponent(key)}`, { headers })","typeGuard":"const isNonEmptyString = (v: unknown): v is string =>\n  typeof v === 'string' && v.trim().length > 0","tryCatchPattern":null,"preventionTips":["Use the correct path: /api/v1/verify/apikey/<key>, not /apikey/verify.","Disable the verify button until the key input is non-empty.","Trim whitespace before embedding the key in the URL."],"tags":["validation","express","path-param","authentication","precondition-failed","flowise","apikey"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}