{"record":{"id":"d6fd97619fd227e5","repo":"Mintplex-Labs/anything-llm","slug":"workspace-not-found-d6fd97","errorCode":null,"errorMessage":"Workspace not found","messagePattern":"Workspace not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"warning","filePath":"server/endpoints/api/workspaceThread/index.js","lineNumber":171,"sourceCode":"                },\n                message: null,\n              }\n            }\n          }\n        }\n      }\n      #swagger.responses[403] = {\n        schema: {\n          \"$ref\": \"#/definitions/InvalidAPIKey\"\n        }\n      }\n      */\n      try {\n        const { slug, threadSlug } = request.params;\n        const { name } = reqBody(request);\n        const workspace = await Workspace.get({ slug: String(slug) });\n        if (!workspace) {\n          response.status(404).json({ message: \"Workspace not found\" });\n          return;\n        }\n\n        const thread = await WorkspaceThread.get({\n          slug: String(threadSlug),\n          workspace_id: workspace.id,\n        });\n        if (!thread) {\n          response.status(404).json({ message: \"Thread not found\" });\n          return;\n        }\n\n        const { thread: updatedThread, message } = await WorkspaceThread.update(\n          thread,\n          { name }\n        );\n        response.status(200).json({ thread: updatedThread, message });\n      } catch (e) {","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/endpoints/api/workspaceThread/index.js#L153-L189","documentation":"HTTP 404 from POST /api/v1/workspace/:slug/thread/:threadSlug/update when Workspace.get({slug}) returns null. Update requests resolve the parent workspace first; an unknown workspace slug fails before the thread is even looked up. Body may carry {name} for the new thread name.","triggerScenarios":"Calling thread update with a workspace slug that does not exist (typo, deleted workspace, name used instead of slug); correct thread slug but wrong parent workspace.","commonSituations":"Workspace was deleted leaving orphaned thread references in client state; slug copied from a different environment; renaming workspaces and assuming slugs follow.","solutions":["Verify the workspace slug with GET /api/v1/workspaces","Confirm the full hierarchy with GET /api/v1/workspace/:slug/thread/:threadSlug/chats before updating","Refresh cached slugs after workspace re-creation","Pass the slug field from the API, never the display name"],"exampleFix":"// before\nawait updateThread('my workspace', 'thread-abc', { name: 'New' });\n// after\nconst { slug } = await getWorkspaceByName('my workspace'); // resolves real slug\nawait updateThread(slug, 'thread-abc', { name: 'New' });","handlingStrategy":"validation","validationCode":"const ws = await fetch(`${BASE}/api/v1/workspace/${slug}`, { headers: AUTH });\nif (ws.status === 404 || ws.status === 400) throw new Error('resolve workspace slug first');","typeGuard":"const isSlugPair = (p) => isWorkspaceSlug(p.slug) && isWorkspaceSlug(p.threadSlug);","tryCatchPattern":null,"preventionTips":["Validate the workspace slug before every thread-scoped call","Cache slugs with a TTL and re-list on 404","Never derive slugs from names by string manipulation - use API-returned values"],"tags":["anythingllm","developer-api","workspace-thread","http-404","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}