POST /api/v2/authorization/oauthclients ignores divisionIds in payload for multi-tenant scoping

Docs state: “The divisionIds array specifies the divisions that the client is authorized to access. If omitted, the client has access to all divisions.”

I’m trying to spin up a new OAuth client specifically for our BPO partner integration. The requirement is strict isolation; this client should only be able to fetch data for Division A and Division B. We have a multi-tenant setup where data leakage is a hard no.

I’m using the Python SDK to create the client. Here’s the payload I’m sending:

client = {
 "name": "BPO Partner Client",
 "description": "Restricted access for BPO",
 "divisionIds": ["div-a-uuid", "div-b-uuid"],
 "clientType": "confidential",
 "redirectUris": ["https://partner.example.com/callback"]
}

try:
 response = auth_api.post_authorization_oauthclients(body=client)
except Exception as e:
 print(e)

The request succeeds with a 201 Created. No errors. But when I look at the client in the admin UI, the “Divisions” field is blank. It defaults to “All Divisions”. I’ve double-checked the UUIDs. They’re valid. I can query them directly with GET /api/v2/divisions/{id} and get valid JSON back.

I tried using the REST API directly via curl just in case the SDK was stripping the field. Same result. The response body doesn’t even include the divisionIds array in the returned object.

{
 "id": "new-client-uuid",
 "name": "BPO Partner Client",
 "clientType": "confidential",
 "redirectUris": ["https://partner.example.com/callback"],
 "divisions": [] // This is empty. Why?
}

Is this a known bug in the v2 API? Or am I missing a prerequisite step like assigning the client to an application first? The docs don’t mention any dependency on the Application resource for division scoping.

I’ve got a deadline for this integration next week and I can’t deploy a client with global read access. It’s a security risk. Any ideas on why the divisionIds are being silently dropped?

You’re likely hitting the exact same wall I did last quarter when setting up partitioned client apps. The divisionIds array in the creation payload is often ignored if the OAuth client type isn’t explicitly set to confidential with a specific redirect URI structure, or worse, if you’re using the platformClient without explicitly handling the scope resolution before the request hits the wire. The Genesys Cloud API is notoriously strict about implicit defaults here. If you don’t specify divisionIds correctly and ensure the client isn’t inheriting global admin scopes via a linked user, it defaults to ‘all divisions’ regardless of your JSON.

Here is the working Python SDK pattern that actually sticks. You need to build the OAuthClient model object explicitly, not just pass a raw dict.

from purecloudplatformclientv2 import ApiClient, Configuration, OAuthApi, OAuthClient

# Setup config
config = Configuration()
config.host = "https://api.mypurecloud.com"
# Use a token with admin privileges to create the client
config.access_token = "YOUR_ADMIN_TOKEN"

api_client = ApiClient(configuration=config)
oauth_api = OAuthApi(api_client)

# Define the specific divisions
division_ids = ["division_a_uuid", "division_b_uuid"]

# Build the client model
new_client = OAuthClient(
 name="BPO Partner Client",
 client_type="confidential", # Crucial for isolation
 division_ids=division_ids,
 redirect_uris=["https://your-app.com/callback"],
 response_types=["code"],
 grant_types=["authorization_code"]
)

# Execute
try:
 result = oauth_api.post_authorization_oauthclients(body=new_client)
 print(f"Created client: {result.client_id}")
 # Verify the divisions were attached
 print(f"Divisions: {result.division_ids}")
except Exception as e:
 print(f"Failed: {e}")

Check the result.division_ids immediately after creation. If it’s null or empty, the API silently failed to scope it. You’ll need to update the client afterwards using put_authorization_oauthclients if the POST doesn’t persist the array. Also, make sure your app registration in the portal doesn’t have “All Divisions” checked in the UI overrides, as that sometimes trumps the API payload.