Jenkins API: what you can do and how to use it with AI agents
Jenkins has a remote API that exposes jobs, builds, the queue and nodes in JSON or XML, and lets you trigger builds with parameters. Engineering and DevOps teams with their own CI/CD servers use it. Access is through a user with an API token, at the URL of the company's own server.
What the Jenkins API offers
Jobs
Listing, configuration and state of each job and pipeline.
Builds
History, result, duration and artifacts.
Triggering builds
Running jobs, with or without parameters.
Console logs
The output of each build, for diagnosis.
Queue
Builds waiting to run.
Nodes and agents
Execution machines and their availability.
How to access the Jenkins API
- With your company’s credentialsA Jenkins user with an API token generated in the profile, sent through basic authentication. Permissions follow the authorization strategy configured on the server.
- Logs can hold secrets, so the agent must not pass them on.
- Do not expose Jenkins to the internet just for the integration. Use a tunnel or a private network.
- Use per-job permissions instead of administrator.
Official documentation: www.jenkins.io/doc/book/using/remote-access-api
What an iTeam agent does with the Jenkins API
Broken build, explained
The agent reads the log of the failed build, points to the stage and the error message, and tells the author of the change.
Flaky test
The agent identifies tests that switch between passing and failing in recent runs and lists them for the team.
Deploy on request
The tech lead asks in Teams for a deploy to staging, and the agent triggers the job with the parameters, after confirmation.
Stuck queue
The agent warns when the queue grows and nodes go offline.
From the credential to the agent at work, with approval
Create a service user
In Jenkins, create the user with read and build permission only on the jobs needed, and generate the token.
Store it in the iTeam vault
The token and URL stay in the vault, with network access approved by IT.
Test with approval
Reading logs runs directly. Triggering production builds goes through human approval.
Ready-made AI teams for this work
Questions about the Jenkins API
Is the Jenkins API free?
Yes. Jenkins is open-source software and the remote API comes with it. The cost is the infrastructure.
Do I need to code to use the Jenkins API with iTeam?
Not necessarily. iTeam's HTTP tool reads the documentation, and the deployment team sets it up with your DevOps team.
Can I trigger builds with parameters?
Yes. The remote API accepts parameters, and in iTeam that action sits behind approval.