Looking for the right pattern to bulk-create users from a CSV using the Genesys Cloud Python SDK.
I’m iterating over a list of user dicts and calling users_api.create_user inside a simple for loop. It works fine for the first 10 or so, then hits a wall.
for user_data in users_from_csv:
try:
response = users_api.create_user(body=user_data)
print(f"Created {response.id}")
except ApiException as e:
if e.status == 429:
print("Rate limited")
break
The 429 is expected, but the SDK doesn’t seem to have a built-in retry or backoff mechanism exposed in the client config. I’m currently just sleeping for 2 seconds in the except block, which feels clunky and slow for 500+ users. Is there a recommended way to handle rate limiting in the Python SDK, or should I be using the batch endpoint instead? The docs mention post_users but the payload structure is different from the standard User model.