Optimizing Retry Logic for 429 Errors in Genesys Cloud User Bulk Updates

Quick question about implementing robust exponential backoff with jitter for Genesys Cloud /api/v2/users bulk updates. I am developing a Microsoft Teams bot that synchronizes user presence status with Genesys Cloud, requiring frequent updates to user availability. Currently, my Python script iterates through a list of users and issues PUT requests to /api/v2/users/{id}. When processing larger batches, I consistently encounter 429 Too Many Requests errors. My current retry mechanism is rudimentary, simply waiting a fixed interval, which proves inefficient and sometimes triggers further rate limiting. I need to implement a more sophisticated backoff strategy that respects the Retry-After header or applies a standard exponential backoff algorithm with jitter to avoid thundering herd problems. Here is my current implementation:

import requests
import time

def update_users(users):
 for user in users:
 url = f"https://api.mypurecloud.com/api/v2/users/{user['id']}"
 payload = {"presence": {"state": user['status']}}
 headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json"}
 
 for attempt in range(5):
 response = requests.put(url, json=payload, headers=headers)
 if response.status_code == 200:
 break
 elif response.status_code == 429:
 retry_after = response.headers.get('Retry-After', 2 ** attempt)
 time.sleep(int(retry_after))
 else:
 raise Exception(f"Failed to update user {user['id']}: {response.status_code}")

Is this approach sufficient, or should I incorporate full jitter logic? Additionally, how should I handle cases where the Retry-After header is missing but the 429 status is returned? I want to ensure my bot remains responsive without overwhelming the Genesys Cloud API gateway. Any best practices for integrating this with the Bot Framework SDK would be appreciated.