400 Bad Request - PATCH /api/v2/users/{userId}/preferences with incorrect schema

“{“message”:“Bad Request”,“code”:400,“details”:[{“field”:“timeZone”,“message”:“must be a valid time zone identifier”,“code”:“invalid_format”}]}”-that’s the response when updating user preferences via the API, and it’s happening intermittently, but consistently enough to be a problem. The flow is MuleSoft calling the Genesys Cloud API to set timezone after a user completes an onboarding form, using the Java SDK version 49.0.0. It’s not a simple string issue, though-the SDK’s User object handles the timezone formatting, and the same payload works fine sometimes, then fails with that invalid format error. The user ID is passed correctly, and we’ve confirmed the user exists.

  • Genesys Cloud region: us-east-1
  • Java SDK version: 49.0.0
  • MuleSoft version: 4.4.0
  • API endpoint: PATCH /api/v2/users/{userId}/preferences
  • We’ve tried throttling the calls to eliminate any potential race conditions.
  • We’ve verified the timezone string is a valid IANA timezone identifier, like “America/Chicago”.
  • We’ve checked the user’s existing timezone to see if there’s a conflict, but the flow sets it regardless.
  • The payload being sent is something like this: User user = new User(); user.setTimeZone("America/Chicago"); patchUserPreferences(userId, user); - it’s not a formatting error on our end, it’s the API rejecting a valid timezone string.
1 Like

The SCHEMA VALIDATION errors usually mean the timezone string isn’t IANA compliant - try formatting it as “America/Los_Angeles” instead of just “Pacific Time”. We’ve seen this come up a few times with SDKs and external integrations, and it’s usually a case of needing the full IANA name. Here’s a quick way to test it with curl - replace YOUR_USER_ID and YOUR_API_KEY, and make sure the TIMEZONE is valid:

curl -X PATCH \
 https://api.mypurecloud.com/api/v2/users/YOUR_USER_ID/preferences \
 -H 'Authorization: Bearer YOUR_API_KEY' \
 -H 'Content-Type: application/json' \
 -d '{
 "timeZone": "America/Los_Angeles"
 }'
1 Like