Endpoint to know if a site latest production deploy succeeded or failed?

I’m using the Netlify API for a project and I’d like to know what endpoint I should use to get the state of the latest production deployment (if it worked or failed).
I currently have a list of my sites with the /sites endpoint and I thought about using the error_message field to check if it’s null or not but all my sites are deployed correctly so I can’t check what it returns when a site’s deploy fail. Is it a good idea or is there another field in this endpoint that would work (I don’t need to have something super detailed just if it is successfully deployed or not ) ?
I’d also like to know what is the state field in this endpoint ?

You can simply use the listSiteDeploys method and get the details about the latest deploy(s). That should have the info you need.