Bitbucket API: what it can do and how to use it with AI agents
The Bitbucket Cloud REST API, from Atlassian, lets you access repositories, pull requests, commits, pipelines and permissions. Development teams that want to automate reviews, deploys and reports use it. Access is by access tokens, app passwords or OAuth.
What the Bitbucket API offers
Repositories
Look up and configure repositories, branches and files.
Pull requests
Create, comment on, approve and merge.
Commits
History, diffs and build status.
Pipelines
Trigger and follow CI/CD runs.
Webhooks
Push, pull request and pipeline events.
Workspaces and permissions
Members, groups and access.
How to access the Bitbucket API
- With your company’s credentialsRepository, project or workspace access tokens, or OAuth 2.0 with a registered consumer. Per-user app credentials are also accepted, following Atlassian's current policy.
- Source code is a sensitive asset: limit the agent to the repositories it needs.
- There are rate limits per user and per endpoint.
- Merging and deploying to production should keep human approval.
Official documentation: developer.atlassian.com/cloud/bitbucket
What an iTeam agent does with the Bitbucket API
Stalled pull requests
The agent lists PRs open for days without review and pings the reviewers in Slack or Teams.
PR summary for the reviewer
When a PR is opened, the agent comments with a summary of the changes and the points that deserve attention.
Pipeline failure explained
When the pipeline breaks, the agent reads the log, points to the step that failed and notifies the commit author.
Release notes
Before a release, the agent drafts the release notes from the merged PRs.
From the credential to the agent at work, with approval
Create a scoped token
Generate an access token on the workspace or repository with the read and comment permissions needed.
Store it in the iTeam vault
The token stays in the vault. Merging and triggering production pipelines remain under approval.
Turn on webhooks on one repository
Start with one repository, adjust the format of the comments and then extend.
Ready-made AI teams for this work
Questions about the Bitbucket API
Is the Bitbucket API free?
The API is available on Bitbucket Cloud plans, including the free one. Pipeline minutes and some features depend on the plan.
Do I need to code to use the Bitbucket API with iTeam?
No. iTeam reads the API documentation, and the deployment team sets up tokens, webhooks and rules.
Can the agent merge?
Yes, if the token allows it, but the recommended default is for it to comment and wait for human approval.