WFM API 400 Bad Request on Shift Pattern Bulk Import

Quick question, has anyone seen this weird error? with the WFM API when pushing shift patterns via the CLI in our automated pipeline.

The setup is standard DevOps flow. Terraform handles the infrastructure, but WFM objects are pushed via a custom Node.js wrapper around the Genesys Cloud SDK v2.4.1. Region is AU-1.

The specific failure occurs during the bulk import of schedule-templates. The payload validates locally. It passes the JSON schema check. But the POST to /api/v2/wfm/schedules/shift-patterns returns a 400 Bad Request. The error body is unhelpful. It just says invalid_request. No specific field is mentioned.

I have tried:

  • Reducing the batch size from 50 to 1. Same error.
  • Using the exact same JSON payload in Postman. It works fine. The difference is the Authorization header flow. Postman uses a fresh token. The CLI uses a cached token with wfm:schedule:write scope.
  • Checking the timezone offsets. All set to Australia/Sydney.

The JSON structure for the shift pattern is minimal. Just start/end times and a label. No complex constraints. Here is the snippet failing:

{
 "name": "StandardDay",
 "timeZone": "Australia/Sydney",
 "segments": [
 {
 "startTime": "09:00",
 "endTime": "17:00",
 "label": "Work"
 }
 ]
}

The stack trace in the CLI logs shows the request is sent correctly. The headers include Accept: application/json and Content-Type: application/json. The token is valid. I can read other WFM resources with the same token.

Is there a known issue with the wfm:schedule:write scope in AU-1? Or is the SDK v2.4.1 sending a malformed body for this endpoint? I am looking at the raw HTTP request via DEBUG=* but nothing stands out. The request body matches the Postman request byte-for-byte.

Any insights on why the API rejects valid payloads in the CLI context?