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:

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:

  • allow_forks: unrestricted forking
  • no_public_forks: restrict forking to private forks (forks cannot be made public later)
  • no_forks: deny all forking
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:
  • owner: returns all repositories owned by the current user (note that using this on an account other than your own will always result in an empty list).
  • admin: returns repositories to which the user has explicit administrator access.
  • contributor: returns repositories to which the user has explicit write access.
  • member: returns repositories to which the user has explicit read access.
GET https://api.bitbucket.org/2.0/repositories/{owner}
  Click here to expand...

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:
  • admin: returns repositories to which the user has explicit administrator access.
  • contributor: returns repositories to which the user has explicit write access.
  • member: returns repositories to which the user has explicit read access.
GET https://api.bitbucket.org/2.0/repositories/{teamname}
  Click here to expand...

To GET all the public repositories for Teams In Space:

Would return:

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:
  • admin: returns repositories to which the user has explicit administrator access.
  • contributor: returns repositories to which the user has explicit write access.
  • member: returns repositories to which the user has explicit read access.
GET  https://api.bitbucket.org/2.0/repositories
  Click here to expand...

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport