{"record":{"id":"58a15b3554a7a76a","repo":"Mintplex-Labs/anything-llm","slug":"workspace-slug-is-required","errorCode":null,"errorMessage":"Workspace slug is required","messagePattern":"Workspace slug is required","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/endpoints/api/embed/index.js","lineNumber":266,"sourceCode":"            }\n          }\n        }\n      }\n      #swagger.responses[403] = {\n        schema: {\n          \"$ref\": \"#/definitions/InvalidAPIKey\"\n        }\n      }\n      #swagger.responses[404] = {\n        description: \"Workspace not found\"\n      }\n    */\n    try {\n      const data = reqBody(request);\n\n      if (!data.workspace_slug)\n        return response\n          .status(400)\n          .json({ error: \"Workspace slug is required\" });\n      const workspace = await Workspace.get({\n        slug: String(data.workspace_slug),\n      });\n\n      if (!workspace)\n        return response.status(404).json({ error: \"Workspace not found\" });\n\n      const { embed, message: error } = await EmbedConfig.new({\n        ...data,\n        workspace_id: workspace.id,\n      });\n\n      response.status(200).json({ embed, error });\n    } catch (e) {\n      console.error(e.message, e);\n      response.sendStatus(500).end();\n    }","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/endpoints/api/embed/index.js#L248-L284","documentation":"Validation guard in the embed-anything API endpoint: the request body lacks a workspace_slug field, so the embed request has no target workspace and is rejected with 400 before the Workspace lookup.","triggerScenarios":"Thrown at server/endpoints/api/embed/index.js:266 when the library encounters an invalid state.","commonSituations":"Calling an embed/workspace endpoint without the required workspace slug parameter.","solutions":["Pass a workspace slug in the request.","Verify the slug matches an existing workspace."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}