repositories Endpoint
Overview
The repositories
endpoint has a number of resources you can use to manage repository resources. For all repository resources, you supply a repo_slug
that identifies the specific repository. For example, the repo_slug
for the repository
https://bitbucket.org/tortoisehg/ thg
is thg
. The following resources are available on repositories:
- repository Resource
- pullrequests Resource
- commits or commit Resource
- branch-restrictions Resource
- diff Resource
- webhooks Resource
- statuses/build Resource
- downloads Resource
- components Resource
- default-reviewers Resource
- fork Resource
The repositories endpoint allow you to control aspects of a repository. An individual respository structure has the following fields:
Field | Description |
---|---|
scm | The source control manager for the repository. This is either hg or git. |
has_wiki | A boolean indicating if the repository has a wiki. |
description | A string containing the repository's description. |
links | An array of related objects. |
updated_on | A date timestamp of the last update to this repository. |
fork_policy | Control the rules for forking this repository. Available values are:
|
created_on | An ISO-8601 date timestamp of this repository's creation date. |
owner | The owner's account. |
size | The size of the repository in bytes. |
parent | The parent repository this repository was forked off (only present on forks). This is a repository object itself. |
has_issues | A boolean indicating a repository has an issue tracker. |
is_private | A boolean indicating if a repository is private or public. |
full_name | The unique key into the repository. This key has the format: {owner}/{repo_slug} |
name | The display name of the repository. |
language | The main (programming) language of the repository source files. |
GET a list of repositories for an account
Gets the list of repositories owned by the specified account. If the caller is properly authenticated and authorized, this method returns a collection containing public and private repositories. Otherwise, this method returns a collection of the public repositories. This produces a paginated response.
Parameter | Required? | Description |
---|---|---|
owner | Yes | The account of the repo owner. |
role | no | To limit the set of returned repositories, apply the role=[owner|admin|contributor|member] parameter where the roles are:
|
GET https://api.bitbucket.org/2.0/repositories/{owner}
GET a list of repositories for a team
Gets the list of repositories owned by the specified team. If the caller is properly authenticated and authorized, this method returns a collection containing public and private repositories. Otherwise, this method returns a collection of the public repositories. This produces a paginated response.
Parameter | Required? | Description |
---|---|---|
teamname | Yes | The teamname (also known as the team id) of the team which owns the repositories. |
role | no | To limit the set of returned repositories, apply the role=[owner|admin|contributor|member] parameter where the roles are:
|
GET https://api.bitbucket.org/2.0/repositories/{teamname}
GET a list of all repositories
Gets a list of all the repositories on Bitbucket Cloud. This produces a paginated response. Pagination only goes forward (it's not possible to navigate to previous pages) and navigation is done by following the URL for the next page.
The returned repositories are ordered by creation date, oldest repositories first. Unless the role
parameter is specified, only public repositories are returned.
Parameter | Required? | Description |
---|---|---|
role | no | To limit the set of returned repositories, apply the role=[owner|admin|contributor|member] parameter where the roles are:
|