We’re experiencing issues with the bulk user upload endpoint in the Training Management module (TW 9.0). When uploading 200+ users via POST /api/training/users/bulk, the process fails midway with duplicate record errors even though we’re checking for existing users beforehand.
The bulk upload endpoint behavior seems inconsistent - sometimes it processes 150 records before failing, other times only 80. The duplicate record validation appears to trigger on records that don’t exist in the system yet. We’re also seeing partial data import issues where some users are created but their training assignments are missing.
{
"error": "DUPLICATE_USER",
"record": 127,
"email": "jsmith@company.com"
}
This is causing significant onboarding delays for new employees. Has anyone encountered similar behavior with the training API bulk operations?
I’ve seen this exact issue. The duplicate validation in TW 9.0 runs asynchronously, so records processed in quick succession can trigger false positives. The API doesn’t wait for each record’s validation to complete before starting the next one. Try adding a small delay between batches or reduce your batch size to 50 users at a time.
Are you using external IDs in your payload? We had partial import problems because the training assignment section requires the user record to be fully committed to the database first. The API processes user creation and assignments in the same transaction, which can fail if there’s any validation delay. Check if your payload structure separates user creation from assignment linking.
The duplicate detection uses email as the primary key check, but there’s a known race condition in 9.0 when multiple records with the same email are in the same batch. Make sure your pre-upload validation removes any internal duplicates in your CSV before sending to the API. Even if the users don’t exist in Trackwise, duplicates within the upload batch itself will cause this error at whatever point the collision occurs.
We’re sending everything in one payload - user details plus their initial training assignments. That might be the issue. The documentation shows you can include assignments in the bulk upload, but maybe that’s causing the transaction timing problems you mentioned.
I recommend implementing a two-phase approach. First bulk upload just the user records without assignments, then use a separate API call to batch-assign training. This gives the database time to commit and index the new users. We reduced our failure rate from 40% to under 2% with this method. Also check your database connection pool settings - insufficient connections can cause partial commits during high-volume operations.