How do I actually extract CSAT survey responses that are tied to specific interactions using the Quality API?
We’re trying to build a reporting dashboard and the goal is to match a survey result back to the call or chat interaction. The docs mention that survey responses are part of the quality evaluation model, but when I hit the /api/v2/quality/evaluations endpoint, the response doesn’t seem to include the CSAT data I need.
Here’s the curl command I’m running:
curl -X GET "https://mycompany.genesys.cloud/api/v2/quality/evaluations?evaluationFormId=12345&status=completed" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json"
The response comes back with a 200 OK, which is good, but the evaluations array is completely empty. I know there are completed surveys because I can see them in the UI. I’ve double-checked the evaluationFormId and it matches the CSAT form we use.
I also tried filtering by interactionId, but that just gives me a 400 Bad Request with a message saying the filter isn’t supported in this context.
{
"status": 400,
"code": "bad.request",
"message": "Invalid filter criteria",
"details": "interactionId is not a valid filter for this endpoint"
}
Is there a different endpoint I should be using? Or maybe a different way to structure the query? I’ve looked at the /api/v2/quality/evaluations/bulk endpoint but that seems to be for creating evaluations, not retrieving them.
The timezone is Europe/London, so I’m not sure if that affects the date range filtering, but I haven’t set any date filters yet. I just want to see any completed evaluations with CSAT data.
Any help would be appreciated. I’m stuck on this one.
Cause: The evaluation record itself doesn’t always hold the raw CSAT payload in a way that’s easy to parse for bulk reporting. You’re looking at quality/evaluations which is great for single-item debugging, but if you want to correlate survey scores back to interactions at scale, you’re fighting the API structure. The real issue is usually that the survey response ID isn’t being explicitly mapped in the evaluation form configuration, or you’re missing the includeSurveyResponses=true query param.
Solution: You need to fetch the evaluations with the survey data explicitly included. Here’s how I handle this in my Terraform state checks to ensure the linkage exists before querying.
First, verify your evaluation form has the CSAT question set to “Required” or “Optional” but definitely enabled. Then, hit the list endpoint with the correct flags:
curl -X GET "https://api.mypurecloud.com/api/v2/quality/evaluations?includeSurveyResponses=true&pageSize=25" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
If the surveyResponses array is still null or empty, your integration likely isn’t passing the interactionId correctly when the survey is submitted. In Architect, make sure you’re using the “Set Participant Data” action to push the interactionId into the survey submission payload.
Here’s a quick Python snippet to parse the nested structure once you get the data:
import requests
evals = requests.get(
"https://api.mypurecloud.com/api/v2/quality/evaluations",
params={"includeSurveyResponses": True},
headers={"Authorization": f"Bearer {token}"}
).json()
for eval_item in evals["entities"]:
if eval_item.get("surveyResponses"):
csat_score = eval_item["surveyResponses"][0].get("score")
interaction_id = eval_item["interactionId"]
print(f"Interaction: {interaction_id}, CSAT: {csat_score}")
Check the interactionId field on the evaluation object. If that’s missing, your survey submission flow is broken upstream.