Agent Scripting API 409 Conflict on Bulk Script Version Updates

Stumbled on a weird bug today with the Agent Scripting API.

We are deploying a new version of our compliance script across 50+ Genesys Cloud organizations via our AppFoundry integration.

The process involves fetching the current script version, updating the content payload, and then pushing the update via POST /api/v2/agent-scripting/scripts.

This works fine for the first 10 organizations.

Then we start hitting 409 Conflict errors.

The error message states that the resource version has changed.

But we are using the ETag header from the initial GET request.

We verified the ETag matches the current version in the GC admin console.

The issue seems to happen when multiple API calls are made within a 2-second window.

Our SDK version is 2023.11.0.

We are using server-to-server OAuth tokens.

The integration runs from our AWS us-west-2 region.

Latency to the GC platform is under 50ms.

We added a retry mechanism with exponential backoff.

The retry fails with the same 409 error.

It feels like the platform is caching the version state incorrectly.

Or perhaps there is a race condition in the versioning logic.

We tried adding a 5-second delay between calls.

That reduced the error rate but did not eliminate it.

We need a reliable way to update scripts at scale.

The current behavior blocks our automated deployment pipeline.

Is this a known limitation of the Agent Scripting API?

Should we be using a different approach for bulk updates?

We considered using the Bulk API but it does not support Agent Scripting resources.

Any insights from the engineering team would be helpful.

We can provide detailed request/response logs if needed.

Thanks.