Genesys Python SDK: Bulk user creation from CSV failing with 400 Bad Request

I’m trying to script a bulk import of users from a CSV file using the Genesys Cloud Python SDK. The goal is straightforward: read the CSV, create a User object for each row, and call users_api.create_user().

The script works fine for the first few users, but then it starts throwing 400 Bad Request errors. The error message is vague, just saying Invalid input. I’ve checked the CSV formatting multiple times. The email addresses are valid, and the external_id is unique for each entry.

Here’s the core loop:

for row in reader:
 user = models.User(
 email=row['email'],
 name=row['name'],
 external_id=row['id'],
 division_id=DIVISION_ID
 )
 try:
 api_response = users_api.create_user(body=user)
 print(f"Created {row['name']}")
 except ApiException as e:
 print(f"Failed {row['name']}: {e.body}")

The failure happens on the create_user call. I’ve tried adding a time.sleep(1) between requests to avoid rate limiting, but the 400s persist. The division_id is definitely correct since the manual test user created in the UI uses the same division. Is there a specific field I’m missing that causes a silent 400? Or is the SDK model expecting a different structure for the external_id?