{"record":{"id":"0279767ebf1a3ba2","repo":"Budibase/budibase","slug":"max-limit-for-upload-is-1000-users-please-reduce","errorCode":null,"errorMessage":"Max limit for upload is 1000 users. Please reduce file size and try again.","messagePattern":"Max limit for upload is 1000 users\\. Please reduce file size and try again\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/worker/src/api/controllers/global/users.ts","lineNumber":191,"sourceCode":"    ctx.body = { message: \"SSO support added.\" }\n  } catch (err: any) {\n    ctx.throw(err.status || 400, err?.message || err)\n  }\n}\n\nconst bulkDelete = async (\n  users: Array<UserIdentifier>,\n  currentUserId: string\n) => {\n  if (users.find(u => u.userId === currentUserId)) {\n    throw new Error(\"Unable to delete self.\")\n  }\n  return await userSdk.db.bulkDelete(users)\n}\n\nconst bulkCreate = async (users: User[], groupIds: string[]) => {\n  if (!env.SELF_HOSTED && users.length > MAX_USERS_UPLOAD_LIMIT) {\n    throw new Error(\n      \"Max limit for upload is 1000 users. Please reduce file size and try again.\"\n    )\n  }\n  return await userSdk.db.bulkCreate(users, groupIds)\n}\n\nexport const bulkUpdate = async (\n  ctx: Ctx<BulkUserRequest, BulkUserResponse>\n) => {\n  const currentUserId = ctx.user._id\n  const input = ctx.request.body\n  let created, deleted\n  try {\n    if (input.create) {\n      const tenantId = context.getTenantId()\n      const users: User[] = input.create.users.map(user => ({\n        ...user,\n        tenantId,","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/worker/src/api/controllers/global/users.ts#L173-L209","documentation":"bulkCreate enforces MAX_USERS_UPLOAD_LIMIT (1000) per call when the deployment is not self-hosted. Exceeding it throws this error and nothing is created. Self-hosted installs are exempt from the cap.","triggerScenarios":"Calling the bulk user create endpoint (or bulk upload/bulkUpdate path) with more than 1000 users in one request on a cloud (non-SELF_HOSTED) environment.","commonSituations":"Uploading a large CSV of employees in one go; migrating users from another system with a single request; scripts that don't paginate user creation.","solutions":["Split the user list into chunks of 1000 or fewer and make multiple bulkCreate calls","Paginate large CSV uploads in the client before submitting","For very large imports, use a self-hosted deployment or contact support to raise limits","Check users.length before calling and surface a friendly message to the user"],"exampleFix":"// before\nawait userSdk.db.bulkCreate(allUsers, groupIds)\n// after\nconst MAX = 1000\nfor (let i = 0; i < allUsers.length; i += MAX) {\n  await userSdk.db.bulkCreate(allUsers.slice(i, i + MAX), groupIds)\n}","handlingStrategy":"validation","validationCode":"const MAX = 1000\nif (users.length > MAX) {\n  throw new Error(`Chunk users into batches of ${MAX} before upload`)\n}","typeGuard":"null","tryCatchPattern":"try {\n  await api.bulkCreate(users, groupIds)\n} catch (e) {\n  if (e.message.includes(\"Max limit for upload\")) {\n    // split into chunks of 1000 and retry sequentially\n  }\n}","preventionTips":["Always chunk large user imports into batches of ≤1000","Paginate CSV parsing before submitting","Check deployment type: self-hosted has no such cap"],"tags":["users","limits","validation","bulk-import"],"backgroundTag":"bulk-upload-limit-exceeded","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}