Bitbucket Refs API

The refs resource allows you access branches and tags in a repository. By default, results will be in the order the underlying source control system returns them and identical to the ordering one sees when running "$ git show-ref". Note that this follows simple lexical ordering of the ref names.

Business capability
Software Construction Management BC-4200.40

Operations 9

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /repositories/{workspace}/{repo_slug}/refs List branches and tags together · List branches and tags #
Ask an LLM
“Can I see every branch and tag in a repo in one list?”
“What refs exist in my repository, both branches and tags?”
Tell an agent
List all branches and tags in {workspace}/{repo_slug}.
Show refs in {workspace}/{repo_slug} matching {q}, branches and tags combined.
GET /repositories/{workspace}/{repo_slug}/refs/branches List open branches · List open branches #
Ask an LLM
“Which branches are open in my Bitbucket repo?”
“Can I search branches by name and sort by most recent commit?”
Tell an agent
List open branches in {workspace}/{repo_slug}.
Find branches in {workspace}/{repo_slug} matching {q}, sorted by {sort}.
POST /repositories/{workspace}/{repo_slug}/refs/branches Create a branch · Create a branch #
Ask an LLM
“How do I create a new branch from a commit through the API?”
“Can I cut a branch off a specific hash without cloning?”
Tell an agent
Create a new branch in {workspace}/{repo_slug}.
Cut a fresh branch from a target commit in {repo_slug}.
DELETE /repositories/{workspace}/{repo_slug}/refs/branches/{name} Delete a branch · Delete a branch #
Ask an LLM
“How do I delete a merged branch?”
“Can I delete the main branch through the API?”
Tell an agent destructive · confirm first
Delete branch {name} from {workspace}/{repo_slug}.
Remove the stale branch {name} in {repo_slug}.
GET /repositories/{workspace}/{repo_slug}/refs/branches/{name} Get a branch · Get a branch #
Ask an LLM
“What commit is a branch pointing at right now?”
“Can I fetch the details of one branch by name?”
Tell an agent
Get branch {name} in {workspace}/{repo_slug}.
Show the head commit of branch {name}.
GET /repositories/{workspace}/{repo_slug}/refs/tags List tags · List tags #
Ask an LLM
“Which release tags exist in my repo?”
“Can I filter tags by name pattern and sort them?”
Tell an agent
List tags in {workspace}/{repo_slug}.
Find tags in {workspace}/{repo_slug} matching {q}.
POST /repositories/{workspace}/{repo_slug}/refs/tags Create an annotated tag · Create a tag #
Ask an LLM
“How do I tag a release commit?”
“Can I add a message when I create a tag?”
Tell an agent
Create tag {name} in {workspace}/{repo_slug}.
Tag commit {target} as {name} with message {message}.
DELETE /repositories/{workspace}/{repo_slug}/refs/tags/{name} Delete a tag · Delete a tag #
Ask an LLM
“How do I remove a tag I created by mistake?”
“Is it possible to delete a release tag?”
Tell an agent destructive · confirm first
Delete tag {name} from {workspace}/{repo_slug}.
Remove the mistaken tag {name} in {repo_slug}.
GET /repositories/{workspace}/{repo_slug}/refs/tags/{name} Get a tag · Get a tag #
Ask an LLM
“Which commit does a given tag point to?”
“Can I look up a tag's tagger and message?”
Tell an agent
Get tag {name} in {workspace}/{repo_slug}.
Show which commit tag {name} points at.

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/bitbucket:bitbucket-refs-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

bitbucket-refs-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Bitbucket Refs API
  description: Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework.
  version: '2.0'
  termsOfService: https://www.atlassian.com/legal/customer-agreement
  contact:
    name: Bitbucket Support
    url: https://support.atlassian.com/bitbucket-cloud/
    email: support@bitbucket.org
servers:
- url: https://api.bitbucket.org/2.0
tags:


# --- truncated at 32 KB (169 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/bitbucket/refs/heads/main/openapi/bitbucket-refs-api-openapi.yml