Python SDK bulk user creation from CSV hangs on large payloads

Building a script to bulk-create users from a CSV using the Genesys Cloud Python SDK. The create_user method works fine for single records, but looping through 500 rows causes the client to hang or timeout after ~200 iterations. No specific error thrown, just silence. Tried increasing the timeout to 60s. Here’s the loop logic:

for row in csv_reader:
 user = PureCloudPlatformClientV2.User()
 user.name = row['name']
 api_instance.create_user(user)

Is there a rate limit on the SDK client itself or should I be batching these requests differently?

SDK doesn’t handle concurrency. You’ll hit rate limits fast with a tight loop. Use ThreadPoolExecutor to parallelize requests. Keep it under 10 threads.

from concurrent.futures import ThreadPoolExecutor

def create_single_user(row):
 # build user object
 users_api.post_users(user)

with ThreadPoolExecutor(max_workers=5) as executor:
 executor.map(create_single_user, rows)

Add a small time.sleep(0.1) inside the worker. Prevents 429s.