Python requests: 401 Unauthorized on Genesys Cloud OAuth token endpoint

Trying to grab an OAuth2 access token via Python requests using client credentials, but getting a 401 Unauthorized.

import requests
url = 'https://api.mypurecloud.com/oauth/token'
payload = {
 'grant_type': 'client_credentials',
 'client_id': 'my_id',
 'client_secret': 'my_secret'
}
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
r = requests.post(url, data=payload, headers=headers)

The response body is just {'error': 'invalid_client'}. The credentials work in Postman. Am I missing a header or is the endpoint different?