Gamification Profile Metric Update 400 Bad Request during KPI adjustment

A 400 Bad Request error occurs when attempting to modify a metric objective via PUT /api/v2/gamification/profiles/{profileId}/metrics/{metricId}. This is preventing the update of performance targets for the current agent engagement cycle.

The objective is to align these metrics with new HR KPIs to maintain agent motivation across the leaderboard. Current configurations in the admin UI appear correct, but the API call fails to commit the changes.

{
 "metricId": "metric-123-abc",
 "objective": 15.5,
 "metricDefinitionId": "def-456-xyz"
}

Our team tried to resolve this by deleting the metric and recreating it using POST /api/v2/gamification/profiles/{profileId}/metrics. This workaround allows the metric to reappear, but it resets the historical data for the agents, which negatively impacts the contest standings.

The issue persists across different profiles in the production environment. The response body for the PUT request doesn’t provide a specific reason for the validation failure.

I think the 400 error is because the PUT request is missing some fields. I think the API doesn’t like it when you only send the target value. In my experience with other things, Genesys usually wants the whole object back. If you only send the change, it just fails.

I think you need to first do a GET /api/v2/gamification/profiles/{profileId}/metrics/{metricId} to see what the current setup is. Then you put that same data back into the PUT call with the new number.

Something like this:

{
 "metricDefinitionId": "12345-abcde-67890",
 "objective": {
 "value": 95.0,
 "operator": "GREATER_THAN_OR_EQUAL"
 }
}

I’m not 100% sure but maybe the operator is wrong too? I think if the operator doesn’t match the metric type it gives a Bad Request. Also, is a profile the same as a scorecard? I always get those mixed up. Try sending the full body and it should work. It’s annoying that the API doesn’t just let you update one field.

2 Likes