Bitbucket Snippets API

Snippets allow you share code segments or files with yourself, members of your workspace, or the world. Like pull requests, repositories and workspaces, the full set of snippets is defined by what the current user has access to. This includes all snippets owned by any of the workspaces the user is a member of, or snippets by other users that the current user is either watching or has collaborated on (for instance by commenting on it).

Operations 25

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 /snippets List snippets I can see (deprecated) · List snippets #
Ask an LLM
“Which code snippets can I access across every workspace?”
“Can I list only the snippets I own using the older global endpoint?”
Tell an agent
List all snippets I can access across workspaces.
Show snippets everywhere where my role is {role}, using the deprecated global listing.
POST /snippets Create a snippet under my account · Create a snippet #
Ask an LLM
“How do I share a quick code snippet from my own account?”
“Can I make a new personal snippet private?”
Tell an agent
Create a snippet titled {title} under my own account.
Create a personal private snippet {title} with is_private {is_private}.
GET /snippets/{workspace} List snippets owned by a workspace · List snippets in a workspace #
Ask an LLM
“What snippets does a particular workspace own?”
“Can I filter a workspace's snippets to ones I contribute to?”
Tell an agent
List the snippets owned by workspace {workspace}.
Show snippets in {workspace} where my role is {role}.
POST /snippets/{workspace} Create a snippet in a workspace · Create a snippet for a workspace #
Ask an LLM
“How do I create a snippet that belongs to a team workspace instead of me?”
“Can I add a private snippet straight into a shared workspace?”
Tell an agent
Create a snippet titled {title} in workspace {workspace}.
Add private snippet {title} to team workspace {workspace} with is_private {is_private}.
DELETE /snippets/{workspace}/{encoded_id} Delete a snippet · Delete a snippet #
Ask an LLM
“How do I permanently delete a snippet?”
“Can I remove a snippet I shared by mistake?”
Tell an agent destructive · confirm first
Delete snippet {encoded_id} from workspace {workspace}.
Permanently remove snippet {encoded_id} owned by {workspace}.
GET /snippets/{workspace}/{encoded_id} Get a snippet · Get a snippet #
Ask an LLM
“What files and title does a specific snippet have at its latest version?”
“How do I fetch a single snippet by its id?”
Tell an agent
Get snippet {encoded_id} in workspace {workspace}.
Show the current version of snippet {encoded_id} owned by {workspace}.
PUT /snippets/{workspace}/{encoded_id} Update a snippet · Update a snippet #
Ask an LLM
“How do I edit the files or title of an existing snippet?”
“Can I change a snippet's contents in place at its latest version?”
Tell an agent
Update snippet {encoded_id} in workspace {workspace}.
Edit the latest version of snippet {encoded_id} owned by {workspace}.
GET /snippets/{workspace}/{encoded_id}/comments List comments on a snippet · List comments on a snippet #
Ask an LLM
“What have people said in the comments on a snippet?”
“Can I read a snippet's discussion thread in order?”
Tell an agent
List comments on snippet {encoded_id} in workspace {workspace}.
Show the discussion on snippet {encoded_id} owned by {workspace}.
POST /snippets/{workspace}/{encoded_id}/comments Comment on a snippet · Create a comment on a snippet #
Ask an LLM
“How do I leave feedback on someone's snippet?”
“Can I post a threaded reply to an existing snippet comment?”
Tell an agent
Add a comment to snippet {encoded_id} in workspace {workspace}.
Reply in the thread on snippet {encoded_id} owned by {workspace}.
DELETE /snippets/{workspace}/{encoded_id}/comments/{comment_id} Delete a comment on a snippet · Delete a comment on a snippet #
Ask an LLM
“How do I remove a comment from a snippet?”
“Can a workspace admin delete someone else's snippet comment?”
Tell an agent destructive · confirm first
Delete comment {comment_id} from snippet {encoded_id} in workspace {workspace}.
Remove snippet comment {comment_id} on {encoded_id} owned by {workspace}.
GET /snippets/{workspace}/{encoded_id}/comments/{comment_id} Get one comment on a snippet · Get a comment on a snippet #
Ask an LLM
“How can I fetch a single snippet comment by its id?”
“What did a specific comment on a snippet say?”
Tell an agent
Get comment {comment_id} on snippet {encoded_id} in workspace {workspace}.
Show snippet comment {comment_id} from {encoded_id} owned by {workspace}.
PUT /snippets/{workspace}/{encoded_id}/comments/{comment_id} Edit a comment on a snippet · Update a comment on a snippet #
Ask an LLM
“Can I fix a comment I posted on a snippet?”
“Who is allowed to edit a snippet comment?”
Tell an agent
Edit comment {comment_id} on snippet {encoded_id} in workspace {workspace}.
Rewrite my snippet comment {comment_id} on {encoded_id} owned by {workspace}.
GET /snippets/{workspace}/{encoded_id}/commits List a snippet's change history · List snippet changes #
Ask an LLM
“How many times has a snippet been edited, and by whom?”
“Can I see every commit made to a snippet?”
Tell an agent
List the commits on snippet {encoded_id} in workspace {workspace}.
Show the edit history of snippet {encoded_id} owned by {workspace}.
GET /snippets/{workspace}/{encoded_id}/commits/{revision} Get one commit made to a snippet · Get a previous snippet change #
Ask an LLM
“What did a particular commit change on a snippet?”
“Who authored a given snippet commit and when?”
Tell an agent
Get commit {revision} of snippet {encoded_id} in workspace {workspace}.
Show the commit details for revision {revision} on snippet {encoded_id} owned by {workspace}.
GET /snippets/{workspace}/{encoded_id}/files/{path} Get a snippet file's raw content at HEAD · Get a snippet's raw file at HEAD #
Ask an LLM
“How do I download the latest raw contents of one file in a snippet?”
“Is there a shortcut to a snippet's current file without fetching the snippet first?”
Tell an agent
Download the latest raw file {path} from snippet {encoded_id} in workspace {workspace}.
Get the current contents of {path} in snippet {encoded_id} owned by {workspace}.
DELETE /snippets/{workspace}/{encoded_id}/watch Stop watching a snippet · Stop watching a snippet #
Ask an LLM
“How do I stop notifications for a snippet?”
“Can I unfollow a snippet I no longer use?”
Tell an agent destructive · confirm first
Stop watching snippet {encoded_id} in workspace {workspace}.
Unsubscribe me from snippet {encoded_id} owned by {workspace}.
GET /snippets/{workspace}/{encoded_id}/watch Check whether I'm watching a snippet · Check if the current user is watching a snippet #
Ask an LLM
“Am I already following a snippet for updates?”
“Does a 404 on the snippet watch check mean I am not watching it?”
Tell an agent
Check whether I am watching snippet {encoded_id} in workspace {workspace}.
Tell me if I follow snippet {encoded_id} owned by {workspace}.
PUT /snippets/{workspace}/{encoded_id}/watch Watch a snippet · Watch a snippet #
Ask an LLM
“How do I get notified when a snippet changes?”
“Can I start following a teammate's snippet?”
Tell an agent
Start watching snippet {encoded_id} in workspace {workspace}.
Subscribe me to changes on snippet {encoded_id} owned by {workspace}.
GET /snippets/{workspace}/{encoded_id}/watchers List users watching a snippet · List users watching a snippet #
Ask an LLM
“Who is following a snippet?”
“How many people watch this snippet?”
Tell an agent
List the watchers of snippet {encoded_id} in workspace {workspace}.
Show who follows snippet {encoded_id} owned by {workspace}.
DELETE /snippets/{workspace}/{encoded_id}/{node_id} Delete a snippet via its latest revision URL · Delete a previous revision of a snippet #
Ask an LLM
“Can I delete a snippet only if it has not changed since a given revision?”
“What happens if I try to delete a snippet using an older revision id?”
Tell an agent destructive · confirm first
Delete snippet {encoded_id} in workspace {workspace} if its latest revision is {node_id}.
Remove snippet {encoded_id} owned by {workspace} using versioned URL {node_id}.
GET /snippets/{workspace}/{encoded_id}/{node_id} Get a snippet as of an older revision · Get a previous revision of a snippet #
Ask an LLM
“What did a snippet look like at an earlier revision?”
“Can I retrieve a snippet pinned to a specific node id?”
Tell an agent
Get snippet {encoded_id} in workspace {workspace} as it was at revision {node_id}.
Show the older version {node_id} of snippet {encoded_id} owned by {workspace}.
PUT /snippets/{workspace}/{encoded_id}/{node_id} Update a snippet at an explicit revision · Update a previous revision of a snippet #
Ask an LLM
“Can I update a snippet only if it is still at the revision I last saw?”
“Why does updating a snippet at an older revision fail?”
Tell an agent
Update snippet {encoded_id} in workspace {workspace} at tip revision {node_id}.
Edit snippet {encoded_id} owned by {workspace}, guarding on head revision {node_id}.
GET /snippets/{workspace}/{encoded_id}/{node_id}/files/{path} Get a snippet file's raw content at a revision · Get a snippet's raw file #
Ask an LLM
“How do I download a snippet file as it was at an older revision?”
“Can I fetch raw file contents from a specific version of a snippet?”
Tell an agent
Download file {path} from snippet {encoded_id} in workspace {workspace} at revision {node_id}.
Get raw {path} of snippet {encoded_id} owned by {workspace} as of version {node_id}.
GET /snippets/{workspace}/{encoded_id}/{revision}/diff Diff a snippet revision against its parent · Get snippet changes between versions #
Ask an LLM
“What lines changed in a snippet between a revision and the one before it?”
“Can I limit a snippet diff to a single file?”
Tell an agent
Show the diff of revision {revision} on snippet {encoded_id} in workspace {workspace}.
Diff snippet {encoded_id} owned by {workspace} at {revision} for file {path} only.
GET /snippets/{workspace}/{encoded_id}/{revision}/patch Get a snippet revision as a patch · Get snippet patch between versions #
Ask an LLM
“Can I export a snippet change as a git patch with commit metadata?”
“Is there a patch-formatted version of a snippet revision?”
Tell an agent
Get the patch for revision {revision} of snippet {encoded_id} in workspace {workspace}.
Export snippet {encoded_id} owned by {workspace} at {revision} as a git patch.

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-snippets-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-snippets-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Bitbucket Snippets 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 (174 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/bitbucket/refs/heads/main/openapi/bitbucket-snippets-api-openapi.yml