[Server] How to See Recent Builds via API?

 

Overview

You can leverage an admin API endpoint to see recent builds on your CircleCI Server.


Prerequisites


You need to be an admin user on the Server instance.
From there, please generate a user API token.

For Server >= 3.x, visit https://app.<server domain>/settings/user/tokens to generate a user API token.

Usage

You can leverage the admin API endpoint as follows:

# to see the first 10 builds
$ curl -H "Circle-Token: <user API token>" \
https://<server domain>/api/v1/admin/recent-builds\?limit\=10

# to see only running builds
$ curl -H "Circle-Token: <user API token>" \
https://<server domain>/api/v1/admin/recent-builds\?status\=running

# to see first 10 queued builds
$ curl -H "Circle-Token: <user API token>" \
https://<server domain>/api/v1/admin/recent-builds\?status\=queued\&limit\=10
Was this article helpful?
1 out of 1 found this helpful

Comments

0 comments

Article is closed for comments.