Need Rest API for finding last 5 jobs run on particular Agent

We have multiple Jenkins Agents and I’m trying to find last 5 jobs run on each Agents so that we can keep the track of agent activity.

So do we have any rest api to achieve above requirement ? i’m aware of http://jenkins-url/computer/agent/builds to fetch build history but it’s not working in curl.

Thanks in advance.

This can’t work with curl as this endpoint is not a rest api. It uses javascript to dynamically fetch the builds on that agent.
Afaik there is no rest api for this. I would also not recommend as finding the builds that ran on an agent is an expensive operation.