Addon
Branch restrictions
Branching model
Commit statuses
Commits
Deployments
Downloads
Issue tracker
Pipelines
Projects
Pullrequests
Refs
Reports
Repositories
Snippets
Source
Ssh
Users
Webhooks
Workspaces
Other operations

Rate this page:

Repositories

A Git repository is a virtual storage of your project. It allows you to save versions of your code, which you can access when needed. The repo resource allows you to access public repos, or repos that belong to a specific workspace.

List public repositories

GET /2.0/repositories

Returns a paginated list of all public repositories.

This endpoint also supports filtering and sorting of the results. See filtering and sorting for more details.

repository

Request

Query parameters
after

string

role

string

Filters the result based on the authenticated user's role on each repository.

  • member: returns repositories to which the user has explicit read access
  • contributor: returns repositories to which the user has explicit write access
  • admin: returns repositories to which the user has explicit administrator access
  • owner: returns all repositories owned by the current user

Valid values: admin, contributor, member, owner

q

string

Query string to narrow down the response as per filtering and sorting. role parameter must also be specified.

sort

string

Field by which the results should be sorted as per filtering and sorting.

Example

1
2
3
4
curl --request GET \
  --url 'https://api.bitbucket.org/2.0/repositories' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses