API call to get hosts that had failures

Does anyone know an API query to get the hosts that failed for a job? I’ve been looking at the job_events API but I’m having trouble to come up with a query.

Thank you.

Found a workaround using jq

curl -u user:password https://tower-url/api/v2/job_events/?job=111111 > job_event_111111.txt

jq ‘.results.summary_fields.host |select (.has_active_failures==true).name’ job_event_111111.txt