← All Articles

How to Bulk Import Users

admin beginner

Import multiple users at once using a CSV file. This is the fastest way to onboard a large team, a new department, or an entire organization into SecureAI.

Prepare Your CSV File

Create a CSV file with one row per user. The file must include a header row with the following columns:

Column Required Description Example
email Yes User's email address jsmith@example.com
name Yes Display name Jane Smith
role No user or admin (defaults to user) user
department No Department name for organization Parts Counter

Example CSV

email,name,role,department
jsmith@example.com,Jane Smith,admin,IT
bwilson@example.com,Bob Wilson,user,Parts Counter
mgarcia@example.com,Maria Garcia,user,Service Desk
tlee@example.com,Tom Lee,user,Warehouse

Formatting Rules

Run the Import

  1. Navigate to Admin Panel > Users.
  2. Click Import Users (top right).
  3. Click Choose File and select your CSV.
  4. Review the preview table. SecureAI validates the file and shows:
    • Total rows detected
    • Rows that will be imported successfully
    • Rows with errors (highlighted in red with the reason)
  5. Click Import to proceed with the valid rows.

Rows with errors are skipped — they do not block the rest of the import.

After Import

Each imported user receives an invitation email with a link to set their password. The email is sent to the address in the CSV.

Role Assignment During Import

Use the role column to assign roles at import time instead of updating each user individually afterward.

Error Handling

Common Import Errors

Error Cause Fix
duplicate_email Email already exists in the system Remove the row or update the existing user instead
invalid_email Email format is invalid Check for typos, missing @, or extra spaces
invalid_role Role value is not user or admin Correct the role value or leave blank for default
missing_required_field email or name column is empty Fill in the required value
encoding_error File is not UTF-8 Re-save the CSV as UTF-8

Partial Imports

If some rows fail, SecureAI imports the valid rows and skips the rest. After the import completes, you can:

  1. Download the error report — a CSV listing the failed rows with error reasons.
  2. Fix the errors in the failed rows.
  3. Re-import only the corrected rows.

You do not need to re-import the entire file. Users already imported successfully will not be duplicated.

Bulk Import via API

For automated onboarding (HR system integration, scripts), use the SecureAI Admin API.

curl -X POST https://your-instance.secureai.example/api/admin/users/import \
  -H "Authorization: Bearer $ADMIN_API_TOKEN" \
  -H "Content-Type: multipart/form-data" \
  -F "file=@users.csv"

The API response includes a summary of imported and failed rows:

{
  "imported": 48,
  "failed": 2,
  "errors": [
    {"row": 12, "email": "bad-email", "reason": "invalid_email"},
    {"row": 37, "email": "existing@example.com", "reason": "duplicate_email"}
  ]
}

Use the same CSV format described above. The API enforces the same validation rules as the UI import.

Troubleshooting

Problem Solution
Import button is grayed out You need the admin role to import users
No invitation emails received Check your email delivery settings in Admin Panel > Settings > Email. Verify the SMTP configuration is correct.
CSV appears garbled in preview Re-save the file as UTF-8. Excel's default CSV format uses Windows-1252 encoding.
Import completes but user count seems wrong Check the error report for skipped rows. Duplicate emails are silently skipped.

Next Steps