If you want all information about all failed reports you can query for reports that have a
status of
failed. An example using curl would look like,
-H 'Content-Type:application/json' \
-d '{"query": "reports { status = \"failed\" }"}'
There are a few other options that might be of interest to you as well, for example you can query for just the certname of all agents whose most recent Puppet run failed with something like,
-H 'Content-Type:application/json' \
-d '{"query": "reports[certname] { status = \"failed\" and latest_report? = true}"}'
You can find more docs on querying the reports endpoint for PuppetDB 5.2.7 here. I hope this helps!