Priority stays at 50 when adding VIP queue members via Routing API

Problem

The Java microservice flags VIP customers correctly but the API side behaves strange. I’m trying to set the priority to 1 when adding them via the Routing API. The request goes through but the priority stays at 50. We’ve tested this three times already.

Code

from purecloudplatformclientv2 import RoutingApi, QueueMember

api_instance = RoutingApi()
body = QueueMember(priority=1, user_id=vip_user_id)
result = api_instance.post_routing_queue_member(queue_id="abc-123", body=body)

Error

purecloudplatformclientv2 builds the payload correctly but returns a 201 Created response. The JSON payload shows "priority": 50 instead of 1. No 4xx or 5xx codes at all. It’s really confusing because the SDK documentation says priority is accepted, but the queue member endpoint seems to ignore it.

Question

purecloudplatformclientv2 handles the QueueMember object correctly on the client side. The Java service passes the right variables. Do I need to call a different endpoint like /api/v2/routing/users/{userId}/queues to force the priority. Or maybe the token scope is wrong. The logs just show the default value every time.

The Java SDK defaults to 50 if the priority field isn’t explicitly set in the QueueMemberAddRequest object, or if it’s wrapped inside a parent key. Genesys Cloud’s routing endpoint is strict about the input contract. You’ll need to flatten the JSON so priority sits at the root level alongside userId and routingProfileId. Check your serialization. If you’re passing "priority": "1" as a string, the parser drops it. It has to be an integer. Honestly, the SDK builder is pretty finicky about type coercion. Here’s the exact payload structure the POST /api/v2/routing/queues/{queueId}/members endpoint expects:

{
 "userId": "your-agent-id-here",
 "routingProfileId": "your-profile-id",
 "status": "available",
 "priority": 1
}

If you’re using the Java SDK, make sure you’re calling .setPriority(1) on the request object before passing it to platformClient.getRoutingApi().postRoutingQueueMember(queueId, request). Missing the scope routing:queue:write won’t throw a 403 here. Just rolls back to default. Also check your retry logic. If the first call times out and your client auto-retries without the priority field, you’ll overwrite the VIP flag with the default 50. Strip the retry wrapper or force idempotency with a custom header.

curl -X POST "https://api.mypurecloud.com/api/v2/routing/queues/{queueId}/members" \
 -H "Authorization: Bearer <token>" \
 -H "Content-Type: application/json" \
 -H "Idempotency-Key: vip-add-{timestamp}" \
 -d '{
 "userId": "agent-id",
 "routingProfileId": "profile-id",
 "status": "available",
 "priority": 1
 }'

Run that raw curl first. If it sticks at 1, the problem is definitely in your Java serialization. The request builder is probably swallowing the integer.