These are the repository's commits. They are paginated and returned in reverse chronological order, similar to the output of git log.
Returns the specified commit.
repository
read:repository:bitbucket
string
Requiredstring
Requiredstring
RequiredThe commit object
allOf [allOf [object, Base Commit], Commit]
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
.
The common base type for both repository and snippet commits.
A repository commit object.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}' \
--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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{
"rendered": {
"message": {
"raw": "Add a GEORDI_OUTPUT_DIR setting",
"markup": "markdown",
"html": "<p>Add a GEORDI_OUTPUT_DIR setting</p>",
"type": "rendered"
}
},
"hash": "f7591a13eda445d9a9167f98eb870319f4b6c2d8",
"repository": {
"name": "geordi",
"type": "repository",
"full_name": "bitbucket/geordi",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/bitbucket/geordi"
},
"html": {
"href": "https://bitbucket.org/bitbucket/geordi"
},
"avatar": {
"href": "https://bytebucket.org/ravatar/%7B85d08b4e-571d-44e9-a507-fa476535aa98%7D?ts=1730260"
}
},
"uuid": "{85d08b4e-571d-44e9-a507-fa476535aa98}"
},
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/commit/f7591a13eda445d9a9167f98eb870319f4b6c2d8"
},
"comments": {
"href": "https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/commit/f7591a13eda445d9a9167f98eb870319f4b6c2d8/comments"
},
"patch": {
"href": "https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/patch/f7591a13eda445d9a9167f98eb870319f4b6c2d8"
},
"html": {
"href": "https://bitbucket.org/bitbucket/geordi/commits/f7591a13eda445d9a9167f98eb870319f4b6c2d8"
},
"diff": {
"href": "https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/diff/f7591a13eda445d9a9167f98eb870319f4b6c2d8"
},
"approve": {
"href": "https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/commit/f7591a13eda445d9a9167f98eb870319f4b6c2d8/approve"
},
"statuses": {
"href": "https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/commit/f7591a13eda445d9a9167f98eb870319f4b6c2d8/statuses"
}
},
"author": {
"raw": "Brodie Rao <a@b.c>",
"type": "author",
"user": {
"display_name": "Brodie Rao",
"uuid": "{9484702e-c663-4afd-aefb-c93a8cd31c28}",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/users/%7B9484702e-c663-4afd-aefb-c93a8cd31c28%7D"
},
"html": {
"href": "https://bitbucket.org/%7B9484702e-c663-4afd-aefb-c93a8cd31c28%7D/"
},
"avatar": {
"href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:3aae1e05-702a-41e5-81c8-f36f29afb6ca/613070db-28b0-421f-8dba-ae8a87e2a5c7/128"
}
},
"type": "user",
"nickname": "brodie",
"account_id": "557058:3aae1e05-702a-41e5-81c8-f36f29afb6ca"
}
},
"summary": {
"raw": "Add a GEORDI_OUTPUT_DIR setting",
"markup": "markdown",
"html": "<p>Add a GEORDI_OUTPUT_DIR setting</p>",
"type": "rendered"
},
"participants": [],
"parents": [
{
"type": "commit",
"hash": "f06941fec4ef6bcb0c2456927a0cf258fa4f899b",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/commit/f06941fec4ef6bcb0c2456927a0cf258fa4f899b"
},
"html": {
"href": "https://bitbucket.org/bitbucket/geordi/commits/f06941fec4ef6bcb0c2456927a0cf258fa4f899b"
}
}
}
],
"date": "2012-07-16T19:37:54+00:00",
"message": "Add a GEORDI_OUTPUT_DIR setting",
"type": "commit"
}
Approve the specified commit as the authenticated user. This operation is only available to users that have explicit access to the repository. In contrast, just the fact that a repository is publicly accessible to users does not give them the ability to approve commits.
repository:write
read:repository:bitbucket
, write:repository:bitbucket
string
Requiredstring
Requiredstring
RequiredThe participant
object recording that the authenticated user approved the commit.
allOf [object, Participant]
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
.
Object describing a user's role on resources like commits or pull requests.
1
2
3
4
curl --request POST \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/approve' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
{
"type": "<string>",
"user": {
"type": "<string>"
},
"role": "PARTICIPANT",
"approved": true,
"state": "approved",
"participated_on": "<string>"
}
Redact the authenticated user's approval of the specified commit. This operation is only available to users that have explicit access to the repository. In contrast, just the fact that a repository is publicly accessible to users does not give them the ability to approve commits.
repository:write
write:repository:bitbucket
string
Requiredstring
Requiredstring
RequiredAn empty response indicating the authenticated user's approval has been withdrawn.
1
2
3
curl --request DELETE \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/approve' \
--header 'Authorization: Bearer <access_token>'
Returns the commit's comments.
This includes both global and inline comments.
The default sorting is oldest to newest and can be overridden with
the sort
query parameter.
repository
read:repository:bitbucket
string
Requiredstring
Requiredstring
Requiredstring
string
A paginated list of commit comments.
A paginated list of commit comments.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/comments' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"size": 142,
"page": 102,
"pagelen": 159,
"next": "<string>",
"previous": "<string>",
"values": [
{
"type": "<string>",
"commit": {
"type": "<string>"
}
}
]
}
Creates new comment on the specified commit.
To post a reply to an existing comment, include the parent.id
field:
1 2 3 4 5
$ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/commit/db9ba1e031d07a02603eae0e559a7adc010257fc/comments/ \ -X POST -u evzijst \ -H 'Content-Type: application/json' \ -d '{"content": {"raw": "One more thing!"}, "parent": {"id": 5728901}}'
repository
read:repository:bitbucket
string
Requiredstring
Requiredstring
RequiredThe specified comment.
allOf [allOf [object, Comment], Commit Comment]
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
.
The base type for all comments. This type should be considered abstract. Each of the "commentable" resources defines its own subtypes (e.g. issue_comment
).
A commit comment.
The newly created comment.
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
curl --request POST \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/comments' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"type": "<string>",
"id": 2154,
"created_on": "<string>",
"updated_on": "<string>",
"content": {
"raw": "<string>",
"markup": "markdown",
"html": "<string>"
},
"user": {
"type": "<string>"
},
"deleted": true,
"inline": {
"from": 57,
"to": 122,
"path": "<string>"
},
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"html": {
"href": "<string>",
"name": "<string>"
},
"code": {
"href": "<string>",
"name": "<string>"
}
},
"commit": {
"type": "<string>"
}
}'
Returns the specified commit comment.
repository
read:repository:bitbucket
integer
Requiredstring
Requiredstring
Requiredstring
RequiredThe commit comment.
allOf [allOf [object, Comment], Commit Comment]
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
.
The base type for all comments. This type should be considered abstract. Each of the "commentable" resources defines its own subtypes (e.g. issue_comment
).
A commit comment.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_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
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
"type": "<string>",
"id": 2154,
"created_on": "<string>",
"updated_on": "<string>",
"content": {
"raw": "<string>",
"markup": "markdown",
"html": "<string>"
},
"user": {
"type": "<string>"
},
"deleted": true,
"inline": {
"from": 57,
"to": 122,
"path": "<string>"
},
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"html": {
"href": "<string>",
"name": "<string>"
},
"code": {
"href": "<string>",
"name": "<string>"
}
},
"commit": {
"type": "<string>"
}
}
Used to update the contents of a comment. Only the content of the comment can be updated.
1 2 3 4
$ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/commit/7f71b5/comments/5728901 \ -X PUT -u evzijst \ -H 'Content-Type: application/json' \ -d '{"content": {"raw": "One more thing!"}'
repository
read:repository:bitbucket
integer
Requiredstring
Requiredstring
Requiredstring
RequiredThe updated comment.
allOf [allOf [object, Comment], Commit Comment]
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
.
The base type for all comments. This type should be considered abstract. Each of the "commentable" resources defines its own subtypes (e.g. issue_comment
).
A commit comment.
The newly updated comment.
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
curl --request PUT \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"type": "<string>",
"id": 2154,
"created_on": "<string>",
"updated_on": "<string>",
"content": {
"raw": "<string>",
"markup": "markdown",
"html": "<string>"
},
"user": {
"type": "<string>"
},
"deleted": true,
"inline": {
"from": 57,
"to": 122,
"path": "<string>"
},
"links": {
"self": {
"href": "<string>",
"name": "<string>"
},
"html": {
"href": "<string>",
"name": "<string>"
},
"code": {
"href": "<string>",
"name": "<string>"
}
},
"commit": {
"type": "<string>"
}
}'
Deletes the specified commit comment.
Note that deleting comments that have visible replies that point to
them will not really delete the resource. This is to retain the integrity
of the original comment tree. Instead, the deleted
element is set to
true
and the content is blanked out. The comment will continue to be
returned by the collections and self endpoints.
repository
read:repository:bitbucket
integer
Requiredstring
Requiredstring
Requiredstring
RequiredIndicates the comment was deleted by this action or a previous delete.
1
2
3
curl --request DELETE \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}' \
--header 'Authorization: Bearer <access_token>'
These are the repository's commits. They are paginated and returned
in reverse chronological order, similar to the output of git log
.
Like these tools, the DAG can be filtered.
Returns all commits in the repo in topological order (newest commit
first). All branches and tags are included (similar to
git log --all
).
Returns all commits in the repo that are not on master
(similar to git log --all ^master
).
Returns all commits that are on refs foo
or bar
, but not on fu
or
fubar
(similar to git log foo bar ^fu ^fubar
).
An optional path
parameter can be specified that will limit the
results to commits that affect that path. path
can either be a file
or a directory. If a directory is specified, commits are returned that
have modified any file in the directory tree rooted by path
. It is
important to note that if the path
parameter is specified, the commits
returned by this endpoint may no longer be a DAG, parent commits that
do not modify the path will be omitted from the response.
Returns all commits that are on refs foo
or bar
, but not on master
that changed the file README.md.
Returns all commits that are on refs foo
or bar
, but not on master
that changed to a file in any file in the directory src or its children.
Because the response could include a very large number of commits, it is paginated. Follow the 'next' link in the response to navigate to the next page of commits. As with other paginated resources, do not construct your own links.
When the include and exclude parameters are more than can fit in a
query string, clients can use a x-www-form-urlencoded
POST instead.
repository
read:repository:bitbucket
string
Requiredstring
RequiredA paginated list of commits
A paginated list of commits.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commits' \
--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
{
"size": 142,
"page": 102,
"pagelen": 159,
"next": "<string>",
"previous": "<string>",
"values": [
{
"type": "<string>",
"hash": "<string>",
"date": "<string>",
"author": {
"type": "<string>"
},
"message": "<string>",
"summary": {
"raw": "<string>",
"markup": "markdown",
"html": "<string>"
},
"parents": []
}
]
}
Identical to GET /repositories/{workspace}/{repo_slug}/commits
,
except that POST allows clients to place the include and exclude
parameters in the request body to avoid URL length issues.
Note that this resource does NOT support new commit creation.
repository
read:repository:bitbucket
string
Requiredstring
RequiredA paginated list of commits
A paginated list of commits.
1
2
3
4
curl --request POST \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commits' \
--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
{
"size": 142,
"page": 102,
"pagelen": 159,
"next": "<string>",
"previous": "<string>",
"values": [
{
"type": "<string>",
"hash": "<string>",
"date": "<string>",
"author": {
"type": "<string>"
},
"message": "<string>",
"summary": {
"raw": "<string>",
"markup": "markdown",
"html": "<string>"
},
"parents": []
}
]
}
These are the repository's commits. They are paginated and returned
in reverse chronological order, similar to the output of git log
.
Like these tools, the DAG can be filtered.
Returns all commits on ref master
(similar to git log master
).
Returns all commits on ref dev
or foo
, except those that are reachable on
master
(similar to git log dev foo ^master
).
An optional path
parameter can be specified that will limit the
results to commits that affect that path. path
can either be a file
or a directory. If a directory is specified, commits are returned that
have modified any file in the directory tree rooted by path
. It is
important to note that if the path
parameter is specified, the commits
returned by this endpoint may no longer be a DAG, parent commits that
do not modify the path will be omitted from the response.
Returns all commits that are on refs dev
or foo
or bar
, but not on master
that changed the file README.md.
Returns all commits that are on refs dev
or foo
, but not on master
that changed to a file in any file in the directory src or its children.
Because the response could include a very large number of commits, it is paginated. Follow the 'next' link in the response to navigate to the next page of commits. As with other paginated resources, do not construct your own links.
When the include and exclude parameters are more than can fit in a
query string, clients can use a x-www-form-urlencoded
POST instead.
repository
read:repository:bitbucket
string
Requiredstring
Requiredstring
RequiredA paginated list of commits
A paginated list of commits.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commits/{revision}' \
--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
{
"size": 142,
"page": 102,
"pagelen": 159,
"next": "<string>",
"previous": "<string>",
"values": [
{
"type": "<string>",
"hash": "<string>",
"date": "<string>",
"author": {
"type": "<string>"
},
"message": "<string>",
"summary": {
"raw": "<string>",
"markup": "markdown",
"html": "<string>"
},
"parents": []
}
]
}
Identical to GET /repositories/{workspace}/{repo_slug}/commits/{revision}
,
except that POST allows clients to place the include and exclude
parameters in the request body to avoid URL length issues.
Note that this resource does NOT support new commit creation.
repository
read:repository:bitbucket
string
Requiredstring
Requiredstring
RequiredA paginated list of commits
A paginated list of commits.
1
2
3
4
curl --request POST \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commits/{revision}' \
--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
{
"size": 142,
"page": 102,
"pagelen": 159,
"next": "<string>",
"previous": "<string>",
"values": [
{
"type": "<string>",
"hash": "<string>",
"date": "<string>",
"author": {
"type": "<string>"
},
"message": "<string>",
"summary": {
"raw": "<string>",
"markup": "markdown",
"html": "<string>"
},
"parents": []
}
]
}
Produces a raw git-style diff.
If the spec
argument to this API is a single commit, the diff is
produced against the first parent of the specified commit.
Two commits separated by ..
may be provided as the spec
, e.g.,
3a8b42..9ff173
. When two commits are provided and the topic
query
parameter is true, this API produces a 2-way three dot diff.
This is the diff between source commit and the merge base of the source
commit and the destination commit. When the topic
query param is false,
a simple git-style diff is produced.
The two commits are interpreted as follows:
git diff
.While similar to patches, diffs:
path=foo/bar.py
query param to filter
the diff to just that one file diffThe raw diff is returned as-is, in whatever encoding the files in the
repository use. It is not decoded into unicode. As such, the
content-type is text/plain
.
repository
read:repository:bitbucket
string
Requiredstring
Requiredstring
Requiredinteger
string
boolean
boolean
boolean
boolean
boolean
The raw diff
1
2
3
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/diff/{spec}' \
--header 'Authorization: Bearer <access_token>'
Produces a response in JSON format with a record for every path modified, including information on the type of the change and the number of lines added and removed.
If the spec
argument to this API is a single commit, the diff is
produced against the first parent of the specified commit.
Two commits separated by ..
may be provided as the spec
, e.g.,
3a8b42..9ff173
. When two commits are provided and the topic
query
parameter is true, this API produces a 2-way three dot diff.
This is the diff between source commit and the merge base of the source
commit and the destination commit. When the topic
query param is false,
a simple git-style diff is produced.
The two commits are interpreted as follows:
git diff
.repository
read:repository:bitbucket
string
Requiredstring
Requiredstring
Requiredboolean
boolean
string
boolean
boolean
The diff stats
A paginated list of diffstats.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/diffstat/{spec}' \
--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
{
"pagelen": 500,
"values": [
{
"type": "diffstat",
"status": "modified",
"lines_removed": 1,
"lines_added": 2,
"old": {
"path": "setup.py",
"escaped_path": "setup.py",
"type": "commit_file",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/src/e1749643d655d7c7014001a6c0f58abaf42ad850/setup.py"
}
}
},
"new": {
"path": "setup.py",
"escaped_path": "setup.py",
"type": "commit_file",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/src/d222fa235229c55dad20b190b0b571adf737d5a6/setup.py"
}
}
}
}
],
"page": 1,
"size": 1
}
Returns the best common ancestor between two commits, specified in a revspec of 2 commits (e.g. 3a8b42..9ff173).
If more than one best common ancestor exists, only one will be returned. It is unspecified which will be returned.
repository
read:repository:bitbucket
string
Requiredstring
Requiredstring
RequiredThe merge base of the provided spec.
allOf [allOf [object, Base Commit], Commit]
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
.
The common base type for both repository and snippet commits.
A repository commit object.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/merge-base/{revspec}' \
--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
{
"type": "<string>",
"hash": "<string>",
"date": "<string>",
"author": {
"type": "<string>"
},
"message": "<string>",
"summary": {
"raw": "<string>",
"markup": "markdown",
"html": "<string>"
},
"parents": [],
"repository": {
"type": "<string>"
},
"participants": [
{
"type": "<string>"
}
]
}
Produces a raw patch for a single commit (diffed against its first
parent), or a patch-series for a revspec of 2 commits (e.g.
3a8b42..9ff173
where the first commit represents the source and the
second commit the destination).
In case of the latter (diffing a revspec), a patch series is returned
for the commits on the source branch (3a8b42
and its ancestors in
our example).
While similar to diffs, patches:
path=foo/bar.py
query parameterThe raw patch is returned as-is, in whatever encoding the files in the
repository use. It is not decoded into unicode. As such, the
content-type is text/plain
.
repository
read:repository:bitbucket
string
Requiredstring
Requiredstring
RequiredThe raw patches
1
2
3
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/patch/{spec}' \
--header 'Authorization: Bearer <access_token>'
Rate this page: