Is it possible to restrict OAuth Client Credentials to specific divisions for multi-tenant BPO?

Is it possible to scope an OAuth client to specific divisions for multi-tenant BPO access?

I am building an async FastAPI proxy using httpx that serves multiple BPO clients. Each client operates in a distinct Genesys Cloud division. I want to use a single service account (Client Credentials flow) but restrict its permissions to only the relevant division to prevent cross-tenant data leakage.

Currently, my token acquisition looks like this:

async def get_gc_token(client_id: str, client_secret: str):
 async with httpx.AsyncClient() as client:
 response = await client.post(
 "https://login.mypurecloud.com/oauth/token",
 data={"grant_type": "client_credentials"},
 auth=(client_id, client_secret)
 )
 return response.json()["access_token"]

I attempted to add a division_id parameter to the POST /oauth/token request body, but I received a 400 Bad Request with the message Invalid grant parameter: division_id.

My environment details:

  • Python 3.11 with FastAPI and httpx.
  • Genesys Cloud US1 region.
  • Service account created via Admin UI with “Read Only” permissions on Conversations.
  • Target divisions are separate for each BPO client.

Does the Client Credentials grant type support division-level scoping at the token issuance level? If not, what is the recommended programmatic way to filter resources by division in the subsequent API calls without hardcoding division IDs in the proxy logic?

Have you tried using the divisionId query parameter on the resource endpoints instead of expecting OAuth scopes to handle tenant isolation? OAuth grants API access, not data segmentation.

The Client Credentials flow does not support division-level scoping. You must filter your requests explicitly.

import httpx

# Token acquisition remains standard
async with httpx.AsyncClient() as client:
 token_resp = await client.post(
 "https://api.mypurecloud.com/oauth/token",
 data={
 "grant_type": "client_credentials",
 "client_id": os.getenv("CLIENT_ID"),
 "client_secret": os.getenv("CLIENT_SECRET")
 }
 )
 access_token = token_resp.json()["access_token"]

 # Division filtering happens here, not in OAuth
 headers = {"Authorization": f"Bearer {access_token}"}
 # Example: Fetch only queues in the 'BPO-Client-A' division
 resp = await client.get(
 "https://api.mypurecloud.com/api/v2/routing/queues",
 headers=headers,
 params={"divisionId": "division-id-for-bpo-client-a"}
 )