{"record":{"id":"33fcab49bfde5970","repo":"medusajs/medusa","slug":"user-with-id-id-was-not-found-33fcab","errorCode":null,"errorMessage":"User with id: ${id} was not found","messagePattern":"User with id: (.+?) was not found","errorType":"exception","errorClass":"MedusaError","httpStatus":404,"severity":"error","filePath":"packages/medusa/src/api/admin/users/[id]/route.ts","lineNumber":34,"sourceCode":"import { refetchUser } from \"../helpers\"\n\n// Get user\nexport const GET = async (\n  req: AuthenticatedMedusaRequest<HttpTypes.AdminUserParams>,\n  res: MedusaResponse<HttpTypes.AdminUserResponse>\n) => {\n  const remoteQuery = req.scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)\n  const { id } = req.params\n\n  const query = remoteQueryObjectFromString({\n    entryPoint: \"user\",\n    variables: { id },\n    fields: req.queryConfig.fields,\n  })\n\n  const [user] = await remoteQuery(query)\n  if (!user) {\n    throw new MedusaError(\n      MedusaError.Types.NOT_FOUND,\n      `User with id: ${id} was not found`\n    )\n  }\n\n  res.status(200).json({ user })\n}\n\n// update user\nexport const POST = async (\n  req: AuthenticatedMedusaRequest<\n    HttpTypes.AdminUpdateUser,\n    HttpTypes.AdminUserParams\n  >,\n  res: MedusaResponse<HttpTypes.AdminUserResponse>\n) => {\n  const workflow = updateUsersWorkflow(req.scope)\n","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/medusa/src/api/admin/users/[id]/route.ts#L16-L52","documentation":"Thrown by GET /admin/users/:id when the remote query for the user returns no rows. Standard NOT_FOUND for a single-user fetch.","triggerScenarios":"GET /admin/users/{id} with an unknown, deleted, or malformed id.","commonSituations":"Following a link to a deleted user profile; using an auth identity id instead of the user id.","solutions":["List users via GET /admin/users to confirm the id","Check whether the user was soft-deleted","Ensure you pass the user id, not the auth identity id"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { const { user } = await medusa.admin.users.retrieve(id) } catch (e) { if (e.type === 'not_found') showNotFoundPage() else throw e }","preventionTips":["Always handle 404 on detail routes","Don't assume ids from external sources exist"],"tags":["admin","users","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}