Skip to main content

Update Repository

Since this endpoint can be used to both update and to create a repository, the request body depends on the intent.

Creation

See the POST documentation for the repository endpoint for an example of the request body.

Update

Note: Changing the name of the repository will cause the location to be changed. This is because the URL of the repo is derived from the name (a process called slugification). In such a scenario, it is possible for the request to fail if the newly created slug conflicts with an existing repository's slug. But if there is no conflict, the new location will be returned in the Location header of the response.

External Documentation

To learn more, visit the Bitbucket documentation.

Parameters

ParameterDescription
Default BranchA ref object, representing a branch or tag in a repository.
Description-
Fork PolicyControls the rules for forking this repository.

allow_forks: unrestricted forking
no_public_forks: restrict forking to private forks (forks cannot
be made public later)
* no_forks: deny all forking.
Has Issues-
Has Wiki-
Is Private-
Language-
ProjectA Bitbucket project.
Projects are used by teams to organize repositories.
Repo SlugThis can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.
Repo name-
Workspace SlugThis can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Example Output

{
"created_on": "2018-06-20T23:17:33.616Z",
"description": "A repository for my bits and bobs",
"fork_policy": "allow_forks",
"full_name": "example-username/bits_and_bobs",
"has_issues": false,
"has_wiki": false,
"is_private": true,
"language": "python",
"links": {
"avatar": {
"href": "https://bytebucket.org/ravatar/%7B7708d810-964c-403f-aa6d-4e949280d614%7D?ts=python"
},
"branches": {
"href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/refs/branches"
},
"clone": [
{
"href": "https://bitbucket.org/example-username/bits_and_bobs.git",
"name": "https"
},
{
"href": "git@bitbucket.org:example-username/bits_and_bobs.git",
"name": "ssh"
}
],
"commits": {
"href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commits"
},
"downloads": {
"href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/downloads"
},
"forks": {
"href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/forks"
},
"html": {
"href": "https://bitbucket.org/example-username/bits_and_bobs"
},
"pullrequests": {
"href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests"
},
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs"
},
"source": {
"href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/src"
},
"tags": {
"href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/refs/tags"
},
"watchers": {
"href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/watchers"
}
},
"mainbranch": {
"name": "master",
"type": "branch"
},
"name": "bits_and_bobs",
"owner": {
"account_id": "123456:daffbc08-1a80-4bd0-98bf-7997de0a3d10",
"display_name": "Example Username",
"links": {
"avatar": {
"href": "https://bitbucket.org/account/example-username/avatar/"
},
"html": {
"href": "https://bitbucket.org/example-username/"
},
"self": {
"href": "https://api.bitbucket.org/2.0/users/example-username"
}
},
"nickname": "example-username",
"type": "user",
"username": "example-username",
"uuid": "{58021780-82b6-4517-b153-0ae73ce3e4b4}"
},
"scm": "git",
"size": 33348,
"slug": "bits_and_bobs",
"type": "repository",
"updated_on": "2018-06-20T23:17:33.616Z",
"uuid": "{7708d810-964c-403f-aa6d-4e949280d614}",
"website": "www.example.com"
}

Workflow Library Example

Update Repository with Bitbucket and Send Results Via Email

Workflow LibraryPreview this Workflow on desktop