Python script to export Genesys analytics to S3 failing with 401

I’m building a daily job to pull agent adherence metrics from Genesys Cloud and dump them to S3 using Python. I’ve got the boto3 part working fine, but the Genesys API call keeps failing. Here’s the snippet:

import requests
headers = {'Authorization': 'Bearer ' + token}
r = requests.get('https://api.mypurecloud.com/api/v2/analytics/users/queues/ring', headers=headers)
print(r.status_code)

It returns 401 Unauthorized. The token is fresh, generated via client credentials. Why is it rejecting the call?