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.
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.
This endpoint is deprecated. We recommend you use the workspace scoped alternative.
repositoryread:repository:bitbucketstring
string
string
string
All public repositories.
A paginated list of repositories.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
"size": 142,
"page": 102,
"pagelen": 159,
"next": "<string>",
"previous": "<string>",
"values": [
{
"type": "<string>",
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"html": {
"href": "<string>",
"name": "<string>"
},
"avatar": {
"href": "<string>",
"name": "<string>"
},
"pullrequests": {
"href": "<string>",
"name": "<string>"
},
"commits": {
"href": "<string>",
"name": "<string>"
},
"forks": {
"href": "<string>",
"name": "<string>"
},
"watchers": {
"href": "<string>",
"name": "<string>"
},
"downloads": {
"href": "<string>",
"name": "<string>"
},
"clone": [
{
"href": "<string>",
"name": "<string>"
}
],
"hooks": {
"href": "<string>",
"name": "<string>"
}
},
"uuid": "<string>",
"full_name": "<string>",
"is_private": true,
"scm": "git",
"owner": {
"type": "<string>"
},
"name": "<string>",
"description": "<string>",
"created_on": "<string>",
"updated_on": "<string>",
"size": 2154,
"language": "<string>",
"has_issues": true,
"has_wiki": true,
"fork_policy": "allow_forks",
"project": {
"type": "<string>"
},
"mainbranch": {
"type": "<string>"
}
}
]
}Returns a paginated list of all repositories owned by the specified workspace.
The result can be narrowed down based on the authenticated user's role.
E.g. with ?role=contributor, only those repositories that the
authenticated user has write access to are returned (this includes any
repo the user is an admin on, as that implies write access).
This endpoint also supports filtering and sorting of the results. See filtering and sorting for more details.
repositoryread:repository:bitbucketstring
Requiredstring
string
string
The repositories owned by the specified account.
A paginated list of repositories.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
"size": 142,
"page": 102,
"pagelen": 159,
"next": "<string>",
"previous": "<string>",
"values": [
{
"type": "<string>",
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"html": {
"href": "<string>",
"name": "<string>"
},
"avatar": {
"href": "<string>",
"name": "<string>"
},
"pullrequests": {
"href": "<string>",
"name": "<string>"
},
"commits": {
"href": "<string>",
"name": "<string>"
},
"forks": {
"href": "<string>",
"name": "<string>"
},
"watchers": {
"href": "<string>",
"name": "<string>"
},
"downloads": {
"href": "<string>",
"name": "<string>"
},
"clone": [
{
"href": "<string>",
"name": "<string>"
}
],
"hooks": {
"href": "<string>",
"name": "<string>"
}
},
"uuid": "<string>",
"full_name": "<string>",
"is_private": true,
"scm": "git",
"owner": {
"type": "<string>"
},
"name": "<string>",
"description": "<string>",
"created_on": "<string>",
"updated_on": "<string>",
"size": 2154,
"language": "<string>",
"has_issues": true,
"has_wiki": true,
"fork_policy": "allow_forks",
"project": {
"type": "<string>"
},
"mainbranch": {
"type": "<string>"
}
}
]
}Returns the object describing this repository.
repositoryread:repository:bitbucketstring
Requiredstring
RequiredThe repository object.
allOf [object, Repository]
Base type for most resource objects. It defines the common type element that identifies an object's type. It also identifies the element as Swagger's discriminator.
A Bitbucket repository.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
"type": "<string>",
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"html": {
"href": "<string>",
"name": "<string>"
},
"avatar": {
"href": "<string>",
"name": "<string>"
},
"pullrequests": {
"href": "<string>",
"name": "<string>"
},
"commits": {
"href": "<string>",
"name": "<string>"
},
"forks": {
"href": "<string>",
"name": "<string>"
},
"watchers": {
"href": "<string>",
"name": "<string>"
},
"downloads": {
"href": "<string>",
"name": "<string>"
},
"clone": [
{
"href": "<string>",
"name": "<string>"
}
],
"hooks": {
"href": "<string>",
"name": "<string>"
}
},
"uuid": "<string>",
"full_name": "<string>",
"is_private": true,
"scm": "git",
"owner": {
"type": "<string>"
},
"name": "<string>",
"description": "<string>",
"created_on": "<string>",
"updated_on": "<string>",
"size": 2154,
"language": "<string>",
"has_issues": true,
"has_wiki": true,
"fork_policy": "allow_forks",
"project": {
"type": "<string>"
},
"mainbranch": {
"type": "<string>"
}
}Since this endpoint can be used to both update and to create a repository, the request body depends on the intent.
See the POST documentation for the repository endpoint for an example of the request body.
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.
repository:adminadmin:repository:bitbucketstring
Requiredstring
RequiredThe repository that is to be updated.
Note that the elements "owner" and "full_name" are ignored since the URL implies them.
allOf [object, Repository]
Base type for most resource objects. It defines the common type element that identifies an object's type. It also identifies the element as Swagger's discriminator.
A Bitbucket repository.
The existing repository has been updated
string
allOf [object, Repository]
Base type for most resource objects. It defines the common type element that identifies an object's type. It also identifies the element as Swagger's discriminator.
A Bitbucket repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
curl --request PUT \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"type": "<string>",
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"html": {
"href": "<string>",
"name": "<string>"
},
"avatar": {
"href": "<string>",
"name": "<string>"
},
"pullrequests": {
"href": "<string>",
"name": "<string>"
},
"commits": {
"href": "<string>",
"name": "<string>"
},
"forks": {
"href": "<string>",
"name": "<string>"
},
"watchers": {
"href": "<string>",
"name": "<string>"
},
"downloads": {
"href": "<string>",
"name": "<string>"
},
"clone": [
{
"href": "<string>",
"name": "<string>"
}
],
"hooks": {
"href": "<string>",
"name": "<string>"
}
},
"uuid": "<string>",
"full_name": "<string>",
"is_private": true,
"parent": {
"type": "<string>"
},
"scm": "git",
"owner": {
"type": "<string>"
},
"name": "<string>",
"description": "<string>",
"created_on": "<string>",
"updated_on": "<string>",
"size": 2154,
"language": "<string>",
"has_issues": true,
"has_wiki": true,
"fork_policy": "allow_forks",
"project": {
"type": "<string>"
},
"mainbranch": {
"type": "<string>"
}
}'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
"type": "<string>",
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"html": {
"href": "<string>",
"name": "<string>"
},
"avatar": {
"href": "<string>",
"name": "<string>"
},
"pullrequests": {
"href": "<string>",
"name": "<string>"
},
"commits": {
"href": "<string>",
"name": "<string>"
},
"forks": {
"href": "<string>",
"name": "<string>"
},
"watchers": {
"href": "<string>",
"name": "<string>"
},
"downloads": {
"href": "<string>",
"name": "<string>"
},
"clone": [
{
"href": "<string>",
"name": "<string>"
}
],
"hooks": {
"href": "<string>",
"name": "<string>"
}
},
"uuid": "<string>",
"full_name": "<string>",
"is_private": true,
"scm": "git",
"owner": {
"type": "<string>"
},
"name": "<string>",
"description": "<string>",
"created_on": "<string>",
"updated_on": "<string>",
"size": 2154,
"language": "<string>",
"has_issues": true,
"has_wiki": true,
"fork_policy": "allow_forks",
"project": {
"type": "<string>"
},
"mainbranch": {
"type": "<string>"
}
}Creates a new repository.
Note: In order to set the project for the newly created repository, pass in either the project key or the project UUID as part of the request body as shown in the examples below:
1 2 3 4 5 6$ curl -X POST -H "Content-Type: application/json" -d '{ "scm": "git", "project": { "key": "MARS" } }' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding
or
1 2 3 4 5 6$ curl -X POST -H "Content-Type: application/json" -d '{ "scm": "git", "project": { "key": "{ba516952-992a-4c2d-acbd-17d502922f96}" } }' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding
The project must be assigned for all repositories. If the project is not provided, the repository is automatically assigned to the oldest project in the workspace.
Note: In the examples above, the workspace ID teamsinspace,
and/or the repository name hablanding can be replaced by UUIDs.
repository:adminadmin:repository:bitbucketstring
Requiredstring
RequiredThe repository that is to be created. Note that most object elements are optional. Elements "owner" and "full_name" are ignored as the URL implies them.
allOf [object, Repository]
Base type for most resource objects. It defines the common type element that identifies an object's type. It also identifies the element as Swagger's discriminator.
A Bitbucket repository.
The newly created repository.
allOf [object, Repository]
Base type for most resource objects. It defines the common type element that identifies an object's type. It also identifies the element as Swagger's discriminator.
A Bitbucket repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
curl --request POST \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"type": "<string>",
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"html": {
"href": "<string>",
"name": "<string>"
},
"avatar": {
"href": "<string>",
"name": "<string>"
},
"pullrequests": {
"href": "<string>",
"name": "<string>"
},
"commits": {
"href": "<string>",
"name": "<string>"
},
"forks": {
"href": "<string>",
"name": "<string>"
},
"watchers": {
"href": "<string>",
"name": "<string>"
},
"downloads": {
"href": "<string>",
"name": "<string>"
},
"clone": [
{
"href": "<string>",
"name": "<string>"
}
],
"hooks": {
"href": "<string>",
"name": "<string>"
}
},
"uuid": "<string>",
"full_name": "<string>",
"is_private": true,
"parent": {
"type": "<string>"
},
"scm": "git",
"owner": {
"type": "<string>"
},
"name": "<string>",
"description": "<string>",
"created_on": "<string>",
"updated_on": "<string>",
"size": 2154,
"language": "<string>",
"has_issues": true,
"has_wiki": true,
"fork_policy": "allow_forks",
"project": {
"type": "<string>"
},
"mainbranch": {
"type": "<string>"
}
}'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
"type": "<string>",
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"html": {
"href": "<string>",
"name": "<string>"
},
"avatar": {
"href": "<string>",
"name": "<string>"
},
"pullrequests": {
"href": "<string>",
"name": "<string>"
},
"commits": {
"href": "<string>",
"name": "<string>"
},
"forks": {
"href": "<string>",
"name": "<string>"
},
"watchers": {
"href": "<string>",
"name": "<string>"
},
"downloads": {
"href": "<string>",
"name": "<string>"
},
"clone": [
{
"href": "<string>",
"name": "<string>"
}
],
"hooks": {
"href": "<string>",
"name": "<string>"
}
},
"uuid": "<string>",
"full_name": "<string>",
"is_private": true,
"scm": "git",
"owner": {
"type": "<string>"
},
"name": "<string>",
"description": "<string>",
"created_on": "<string>",
"updated_on": "<string>",
"size": 2154,
"language": "<string>",
"has_issues": true,
"has_wiki": true,
"fork_policy": "allow_forks",
"project": {
"type": "<string>"
},
"mainbranch": {
"type": "<string>"
}
}Deletes the repository. This is an irreversible operation. This does not affect its forks.
repository:deletedelete:repository:bitbucketstring
Requiredstring
Requiredstring
Indicates successful deletion.
1
2
3
curl --request DELETE \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}' \
--header 'Authorization: Bearer <access_token>'Returns a paginated list of all the forks of the specified repository.
repositoryread:repository:bitbucketstring
Requiredstring
Requiredstring
string
string
All forks.
A paginated list of repositories.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/forks' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
"size": 142,
"page": 102,
"pagelen": 159,
"next": "<string>",
"previous": "<string>",
"values": [
{
"type": "<string>",
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"html": {
"href": "<string>",
"name": "<string>"
},
"avatar": {
"href": "<string>",
"name": "<string>"
},
"pullrequests": {
"href": "<string>",
"name": "<string>"
},
"commits": {
"href": "<string>",
"name": "<string>"
},
"forks": {
"href": "<string>",
"name": "<string>"
},
"watchers": {
"href": "<string>",
"name": "<string>"
},
"downloads": {
"href": "<string>",
"name": "<string>"
},
"clone": [
{
"href": "<string>",
"name": "<string>"
}
],
"hooks": {
"href": "<string>",
"name": "<string>"
}
},
"uuid": "<string>",
"full_name": "<string>",
"is_private": true,
"scm": "git",
"owner": {
"type": "<string>"
},
"name": "<string>",
"description": "<string>",
"created_on": "<string>",
"updated_on": "<string>",
"size": 2154,
"language": "<string>",
"has_issues": true,
"has_wiki": true,
"fork_policy": "allow_forks",
"project": {
"type": "<string>"
},
"mainbranch": {
"type": "<string>"
}
}
]
}Creates a new fork of the specified repository.
To create a fork, specify the workspace explicitly as part of the request body:
1 2 3 4 5 6 7$ curl -X POST -u jdoe https://api.bitbucket.org/2.0/repositories/atlassian/bbql/forks \ -H 'Content-Type: application/json' -d '{ "name": "bbql_fork", "workspace": { "slug": "atlassian" } }'
To fork a repository into the same workspace, also specify a new name.
When you specify a value for name, it will also affect the slug.
The slug is reflected in the repository URL of the new fork. It is
derived from name by substituting non-ASCII characters, removes
whitespace, and changes characters to lower case. For example,
My repo would turn into my_repo.
You need contributor access to create new forks within a workspace.
By default the fork inherits most of its properties from the parent.
However, since the optional POST body document follows the normal
repository JSON schema and you can override the new fork's
properties.
Properties that can be overridden include:
is_private=False would fail)is_private
must be true)Properties that cannot be modified include:
repository:writeread:repository:bitbucket, write:repository:bitbucketstring
Requiredstring
RequiredA repository object. This can be left blank.
allOf [object, Repository]
Base type for most resource objects. It defines the common type element that identifies an object's type. It also identifies the element as Swagger's discriminator.
A Bitbucket repository.
The newly created fork.
string
allOf [object, Repository]
Base type for most resource objects. It defines the common type element that identifies an object's type. It also identifies the element as Swagger's discriminator.
A Bitbucket repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
curl --request POST \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/forks' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"type": "<string>",
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"html": {
"href": "<string>",
"name": "<string>"
},
"avatar": {
"href": "<string>",
"name": "<string>"
},
"pullrequests": {
"href": "<string>",
"name": "<string>"
},
"commits": {
"href": "<string>",
"name": "<string>"
},
"forks": {
"href": "<string>",
"name": "<string>"
},
"watchers": {
"href": "<string>",
"name": "<string>"
},
"downloads": {
"href": "<string>",
"name": "<string>"
},
"clone": [
{
"href": "<string>",
"name": "<string>"
}
],
"hooks": {
"href": "<string>",
"name": "<string>"
}
},
"uuid": "<string>",
"full_name": "<string>",
"is_private": true,
"parent": {
"type": "<string>"
},
"scm": "git",
"owner": {
"type": "<string>"
},
"name": "<string>",
"description": "<string>",
"created_on": "<string>",
"updated_on": "<string>",
"size": 2154,
"language": "<string>",
"has_issues": true,
"has_wiki": true,
"fork_policy": "allow_forks",
"project": {
"type": "<string>"
},
"mainbranch": {
"type": "<string>"
}
}'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
"type": "<string>",
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"html": {
"href": "<string>",
"name": "<string>"
},
"avatar": {
"href": "<string>",
"name": "<string>"
},
"pullrequests": {
"href": "<string>",
"name": "<string>"
},
"commits": {
"href": "<string>",
"name": "<string>"
},
"forks": {
"href": "<string>",
"name": "<string>"
},
"watchers": {
"href": "<string>",
"name": "<string>"
},
"downloads": {
"href": "<string>",
"name": "<string>"
},
"clone": [
{
"href": "<string>",
"name": "<string>"
}
],
"hooks": {
"href": "<string>",
"name": "<string>"
}
},
"uuid": "<string>",
"full_name": "<string>",
"is_private": true,
"scm": "git",
"owner": {
"type": "<string>"
},
"name": "<string>",
"description": "<string>",
"created_on": "<string>",
"updated_on": "<string>",
"size": 2154,
"language": "<string>",
"has_issues": true,
"has_wiki": true,
"fork_policy": "allow_forks",
"project": {
"type": "<string>"
},
"mainbranch": {
"type": "<string>"
}
}Returns a paginated list of webhooks installed on this repository.
webhookread:webhook:bitbucketstring
Requiredstring
RequiredThe paginated list of installed webhooks.
A paginated list of webhook subscriptions
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/hooks' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"size": 142,
"page": 102,
"pagelen": 159,
"next": "<string>",
"previous": "<string>",
"values": [
{
"type": "<string>",
"uuid": "<string>",
"url": "<string>",
"description": "<string>",
"subject_type": "repository",
"active": true,
"created_at": "<string>",
"events": [
"issue:comment_created"
],
"secret_set": true,
"secret": "<string>"
}
]
}Creates a new webhook on the specified repository.
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14$ curl -X POST -u credentials -H 'Content-Type: application/json' https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo-slug/hooks -d ' { "description": "Webhook Description", "url": "https://example.com/", "active": true, "secret": "this is a really bad secret", "events": [ "repo:push", "issue:created", "issue:updated" ] }'
When the secret is provided it will be used as the key to generate a HMAC
digest value sent in the X-Hub-Signature header at delivery time. Passing
a null or empty secret or not passing a secret will leave the webhook's
secret unset. Bitbucket only generates the X-Hub-Signature when the webhook's
secret is set.
Note that this call requires the webhook scope, as well as any scope
that applies to the events that the webhook subscribes to. In the
example above that means: webhook, repository and issue.
Also note that the url must properly resolve and cannot be an
internal, non-routed address.
webhookread:webhook:bitbucket, write:webhook:bitbucketstring
Requiredstring
RequiredIf the webhook was registered successfully.
string
allOf [object, Webhook Subscription]
Base type for most resource objects. It defines the common type element that identifies an object's type. It also identifies the element as Swagger's discriminator.
A Webhook subscription.
1
2
3
4
curl --request POST \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/hooks' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"type": "<string>",
"uuid": "<string>",
"url": "<string>",
"description": "<string>",
"subject_type": "repository",
"active": true,
"created_at": "<string>",
"events": [
"issue:comment_created"
],
"secret_set": true,
"secret": "<string>"
}Returns the webhook with the specified id installed on the specified repository.
webhookread:webhook:bitbucketstring
Requiredstring
Requiredstring
RequiredThe webhook subscription object.
allOf [object, Webhook Subscription]
Base type for most resource objects. It defines the common type element that identifies an object's type. It also identifies the element as Swagger's discriminator.
A Webhook subscription.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/hooks/{uid}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"type": "<string>",
"uuid": "<string>",
"url": "<string>",
"description": "<string>",
"subject_type": "repository",
"active": true,
"created_at": "<string>",
"events": [
"issue:comment_created"
],
"secret_set": true,
"secret": "<string>"
}Updates the specified webhook subscription.
The following properties can be mutated:
descriptionurlsecretactiveeventsThe hook's secret is used as a key to generate the HMAC hex digest sent in the
X-Hub-Signature header at delivery time. This signature is only generated
when the hook has a secret.
Set the hook's secret by passing the new value in the secret field. Passing a
null value in the secret field will remove the secret from the hook. The
hook's secret can be left unchanged by not passing the secret field in the
request.
webhookread:webhook:bitbucket, write:webhook:bitbucketstring
Requiredstring
Requiredstring
RequiredThe webhook subscription object.
allOf [object, Webhook Subscription]
Base type for most resource objects. It defines the common type element that identifies an object's type. It also identifies the element as Swagger's discriminator.
A Webhook subscription.
1
2
3
4
curl --request PUT \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/hooks/{uid}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"type": "<string>",
"uuid": "<string>",
"url": "<string>",
"description": "<string>",
"subject_type": "repository",
"active": true,
"created_at": "<string>",
"events": [
"issue:comment_created"
],
"secret_set": true,
"secret": "<string>"
}Deletes the specified webhook subscription from the given repository.
webhookdelete:webhook:bitbucketstring
Requiredstring
Requiredstring
RequiredWhen the webhook was deleted successfully
1
2
3
curl --request DELETE \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/hooks/{uid}' \
--header 'Authorization: Bearer <access_token>'repository:adminadmin:repository:bitbucketstring
Requiredstring
RequiredThe repository setting inheritance state
A json object representing the repository's inheritance state values
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/override-settings' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'1
2
3
4
{
"type": "<string>",
"override_settings": {}
}repository:adminadmin:repository:bitbucketstring
Requiredstring
RequiredThe repository setting inheritance state was set and no content returned
1
2
3
curl --request PUT \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/override-settings' \
--header 'Authorization: Bearer <access_token>'Returns a paginated list of explicit group permissions for the given repository. This endpoint does not support BBQL features.
repository:adminread:repository:bitbucketstring
Requiredstring
RequiredPaginated of explicit group permissions on the repository.
A paginated list of repository group permissions.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/permissions-config/groups' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
"pagelen": 10,
"values": [
{
"type": "repository_group_permission",
"group": {
"type": "group",
"name": "Administrators",
"slug": "administrators"
},
"permission": "admin",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian_tutorial/geordi/permissions-config/groups/administrators"
}
}
},
{
"type": "repository_group_permission",
"group": {
"type": "group",
"name": "Developers",
"slug": "developers"
},
"permission": "read",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian_tutorial/geordi/permissions-config/groups/developers"
}
}
}
],
"page": 1,
"size": 2
}Returns the group permission for a given group slug and repository
Only users with admin permission for the repository may access this resource.
Permissions can be:
adminwritereadnonerepository:adminread:repository:bitbucketstring
Requiredstring
Requiredstring
RequiredGroup permission for group slug and repository
A group's permission for a given repository.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"type": "repository_group_permission",
"group": {
"type": "group",
"name": "Developers",
"slug": "developers",
"full_slug": "atlassian_tutorial:developers"
},
"permission": "read",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian_tutorial/geordi/permissions-config/groups/developers"
}
}
}Updates the group permission, or grants a new permission if one does not already exist.
Only users with admin permission for the repository may access this resource.
The only authentication method supported for this endpoint is via app passwords.
Permissions can be:
adminwritereadrepository:adminadmin:repository:bitbucket, write:permission:bitbucketstring
Requiredstring
Requiredstring
RequiredThe permission to grant
string
RequiredGroup permission updated
A group's permission for a given repository.
1
2
3
4
5
6
7
8
curl --request PUT \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"permission": "read"
}'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"type": "repository_group_permission",
"group": {
"type": "group",
"name": "Developers",
"slug": "developers",
"full_slug": "atlassian_tutorial:developers"
},
"permission": "write",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian_tutorial/geordi/permissions-config/groups/developers"
}
}
}Deletes the repository group permission between the requested repository and group, if one exists. Only users with admin permission for the repository may access this resource. The only authentication method supported for this endpoint is via app passwords.
repository:adminadmin:repository:bitbucket, delete:permission:bitbucketstring
Requiredstring
Requiredstring
RequiredGroup permission deleted
1
2
3
curl --request DELETE \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}' \
--header 'Authorization: Bearer <access_token>'Returns a paginated list of explicit user permissions for the given repository. This endpoint does not support BBQL features.
repository:adminread:repository:bitbucketstring
Requiredstring
RequiredPaginated of explicit user permissions on the repository.
A paginated list of repository user permissions.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/permissions-config/users' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
"pagelen": 10,
"values": [
{
"type": "repository_user_permission",
"user": {
"type": "user",
"display_name": "Colin Cameron",
"uuid": "{d301aafa-d676-4ee0-88be-962be7417567}",
"account_id": "557058:ba8948b2-49da-43a9-9e8b-e7249b8e324a"
},
"permission": "admin",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian_tutorial/geordi/permissions-config/users/557058:ba8948b2-49da-43a9-9e8b-e7249b8e324a"
}
}
},
{
"type": "repository_user_permission",
"user": {
"type": "user",
"display_name": "Sean Conaty",
"uuid": "{504c3b62-8120-4f0c-a7bc-87800b9d6f70}",
"account_id": "557058:ba8948b2-49da-43a9-9e8b-e7249b8e324c"
},
"permission": "write",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0//repositories/atlassian_tutorial/geordi/permissions-config/users/557058:ba8948b2-49da-43a9-9e8b-e7249b8e324c"
}
}
}
],
"page": 1,
"size": 2
}Returns the explicit user permission for a given user and repository.
Only users with admin permission for the repository may access this resource.
Permissions can be:
adminwritereadnonerepository:adminread:repository:bitbucketstring
Requiredstring
Requiredstring
RequiredExplicit user permission for user and repository
A user's direct permission for a given repository.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/permissions-config/users/{selected_user_id}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"type": "repository_user_permission",
"user": {
"type": "user",
"display_name": "Colin Cameron",
"uuid": "{d301aafa-d676-4ee0-88be-962be7417567}",
"account_id": "557058:ba8948b2-49da-43a9-9e8b-e7249b8e324a",
"nickname": "Colin Cameron"
},
"permission": "admin",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian_tutorial/geordi/permissions-config/users/557058:ba8948b2-49da-43a9-9e8b-e7249b8e324a"
}
}
}Updates the explicit user permission for a given user and repository. The selected user must be a member of the workspace, and cannot be the workspace owner. Only users with admin permission for the repository may access this resource.
The only authentication method for this endpoint is via app passwords.
Permissions can be:
adminwritereadrepository:adminadmin:repository:bitbucket, write:permission:bitbucketstring
Requiredstring
Requiredstring
RequiredThe permission to grant
string
RequiredExplicit user permission updated
A user's direct permission for a given repository.
1
2
3
4
5
6
7
8
curl --request PUT \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/permissions-config/users/{selected_user_id}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"permission": "read"
}'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"type": "repository_user_permission",
"user": {
"type": "user",
"display_name": "Colin Cameron",
"uuid": "{d301aafa-d676-4ee0-88be-962be7417567}",
"account_id": "557058:ba8948b2-49da-43a9-9e8b-e7249b8e324a",
"nickname": "Colin Cameron"
},
"permission": "write",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/atlassian_tutorial/geordi/permissions-config/users/557058:ba8948b2-49da-43a9-9e8b-e7249b8e324a"
}
}
}Deletes the repository user permission between the requested repository and user, if one exists. Only users with admin permission for the repository may access this resource. The only authentication method for this endpoint is via app passwords.
repository:adminadmin:repository:bitbucket, delete:permission:bitbucketstring
Requiredstring
Requiredstring
RequiredThe repository user permission was deleted and no content returned.
1
2
3
curl --request DELETE \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/permissions-config/users/{selected_user_id}' \
--header 'Authorization: Bearer <access_token>'Returns a paginated list of all the watchers on the specified repository.
repositoryread:repository:bitbucketstring
Requiredstring
RequiredA paginated list of all the watchers on the specified repository.
A paginated list of accounts.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/watchers' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"size": 142,
"page": 102,
"pagelen": 159,
"next": "<string>",
"previous": "<string>",
"values": [
{
"type": "<string>",
"links": {},
"created_on": "<string>",
"display_name": "<string>",
"uuid": "<string>"
}
]
}Returns an object for each repository the caller has explicit access to and their effective permission — the highest level of permission the caller has. This does not return public repositories that the user was not granted any specific permission in, and does not distinguish between explicit and implicit privileges.
Permissions can be:
adminwritereadResults may be further filtered or sorted by repository or permission by adding the following query string parameters:
q=repository.name="geordi" or q=permission>"read"sort=repository.nameNote that the query parameter values need to be URL escaped so that =
would become %3D.
This endpoint is deprecated. We recommend you use the workspace scoped alternative.
accountrepositoryread:repository:bitbucketstring
string
Repository permissions for the repositories a caller has explicit access to.
A paginated list of repository permissions.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/user/permissions/repositories' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"pagelen": 10,
"values": [
{
"type": "repository_permission",
"user": {
"type": "user",
"nickname": "evzijst",
"display_name": "Erik van Zijst",
"uuid": "{d301aafa-d676-4ee0-88be-962be7417567}"
},
"repository": {
"type": "repository",
"name": "geordi",
"full_name": "bitbucket/geordi",
"uuid": "{85d08b4e-571d-44e9-a507-fa476535aa98}"
},
"permission": "admin"
}
],
"page": 1,
"size": 1
}Rate this page: