Creates a branch in the specified repository.
The authenticated user must have an effective REPO_WRITE permission to call this resource. If branch permissions are set up in the repository, the authenticated user must also have access to the branch name that is to be created.
string
Requiredstring
Requiredboolean
string
string
object
JSON representation of the newly created branch
1
2
3
4
5
6
7
8
9
curl --request POST \
--url 'http://{baseurl}/rest/branch-utils/latest/projects/{projectKey}/repos/{repositorySlug}/branches' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"empty": true,
"name": "<string>",
"startPoint": "<string>"
}'
Deletes a branch in the specified repository.
If the branch does not exist, this operation will not raise an error. In other words after calling this resource and receiving a 204 response the branch provided in the request is guaranteed to not exist in the specified repository any more, regardless of its existence beforehand.
The optional 'endPoint' parameter of the request may contain a commit ID that the provided ref name is expected to point to. Should the ref point to a different commit ID, a 400 response will be returned with appropriate error details.
The authenticated user must have an effective REPO_WRITE permission to call this resource. If branch permissions are set up in the repository, the authenticated user must also have access to the branch name that is to be deleted.
string
Requiredstring
Requiredboolean
boolean
string
string
object
An empty response indicating that the branch no longer exists in the repository
1
2
3
4
5
6
7
8
9
curl --request DELETE \
--url 'http://{baseurl}/rest/branch-utils/latest/projects/{projectKey}/repos/{repositorySlug}/branches' \
--header 'Content-Type: application/json' \
--data '{
"dryRun": true,
"empty": true,
"endPoint": "<string>",
"name": "<string>"
}'
Gets the branch information associated with a single commit from a given repository.
string
Requiredstring
Requiredstring
Requiredinteger
integer
a page of branch refs associated with the commit
Page of refs
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/branch-utils/latest/projects/{projectKey}/repos/{repositorySlug}/branches/info/{commitId}' \
--header 'Accept: application/json;charset=UTF-8'
Creates a tag in the specified repository.
The authenticated user must have an effective REPO_WRITE permission to call this resource.
'LIGHTWEIGHT' and 'ANNOTATED' are the two type of tags that can be created. The 'startPoint' can either be a ref or a 'commit'.
string
Requiredstring
RequiredThe create git tag request.
boolean
string
string
string
string
A JSON representation of the newly created tag.
1
2
3
4
5
6
7
8
9
10
11
curl --request POST \
--url 'http://{baseurl}/rest/git/latest/projects/{projectKey}/repos/{repositorySlug}/tags' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"force": true,
"message": "A new release tag",
"name": "release-tag",
"startPoint": "refs/heads/master",
"type": "ANNOTATED"
}'
1
2
3
4
5
6
7
8
{
"hash": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
Deletes a tag in the specified repository.
The authenticated user must have an effective REPO_WRITE permission to call this resource.
string
Requiredstring
Requiredstring
RequiredAn empty response indicating that the tag no longer exists in the repository.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/git/latest/projects/{projectKey}/repos/{repositorySlug}/tags/{name}'
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
Requireddefault response
any
1
2
curl --request PUT \
--url 'http://{baseurl}/rest/comment-likes/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}/reactions/{emoticon}'
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
Requireddefault response
any
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/comment-likes/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}/reactions/{emoticon}'
Search for restrictions using the supplied parameters.
The authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.
string
Requiredstring
Requiredstring
string
string
number
number
A response containing a page of restrictions.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions' \
--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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{
"values": [
{
"accessKeys": [
{
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"key": {
"bitLength": 2154,
"algorithmType": "<string>",
"text": "sh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1",
"id": 1
},
"permission": "USER_ADMIN"
}
],
"groups": [
"group_a",
"group_b"
],
"matcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"name": "Branch",
"id": "ANY_REF"
}
},
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
],
"id": 1,
"type": "pull-request-only"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Allows creating multiple restrictions at once.
string
Requiredstring
RequiredThe request containing a list of the details of the restrictions to create.
array<RestRestrictionRequest>
array<integer>
array<RestSshAccessKey>
array<string>
array<string>
object
string
array<string>
array<RestApplicationUser>
Response contains the ref restriction that was just created.
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions' \
--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
98
99
100
101
102
103
104
105
106
107
108
109
110
{
"accessKeys": [
{
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"key": {
"bitLength": 2154,
"algorithmType": "<string>",
"text": "sh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1",
"id": 1
},
"permission": "USER_ADMIN"
}
],
"groups": [
"group_a",
"group_b"
],
"matcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"name": "Branch",
"id": "ANY_REF"
}
},
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
],
"id": 1,
"type": "pull-request-only"
}
Returns a restriction as specified by a restriction id.
The authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.
string
Requiredstring
Requiredstring
RequiredA response containing the restriction.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions/{id}' \
--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
98
99
100
101
102
103
104
105
106
107
108
109
110
{
"accessKeys": [
{
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"key": {
"bitLength": 2154,
"algorithmType": "<string>",
"text": "sh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1",
"id": 1
},
"permission": "USER_ADMIN"
}
],
"groups": [
"group_a",
"group_b"
],
"matcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"name": "Branch",
"id": "ANY_REF"
}
},
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"users": [
{
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
],
"id": 1,
"type": "pull-request-only"
}
Deletes a restriction as specified by a restriction id.
The authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.
string
Requiredstring
Requiredstring
RequiredAn empty response indicating that the operation was successful
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions/{id}'
Retrieves the synchronization status for the specified repository. In addition to listing refs which cannot be synchronized, if any, the status also provides the timestamp for the most recent synchronization and indicates whether synchronization is available and enabled. If "?at" is specified in the URL, the synchronization status for the specified ref is returned, rather than the complete repository status.
The authenticated user must have REPO_READ permission for the repository, or it must be public if the request is anonymous. Additionally, after synchronization is enabled for a repository, meaning synchronization was available at that time, permission changes and other actions can cause it to become unavailable. Even when synchronization is enabled, if it is no longer available for the repository it will not be performed.
string
Requiredstring
Requiredstring
Synchronization status for the specified repository, or specific ref within that repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/sync/latest/projects/{projectKey}/repos/{repositorySlug}' \
--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
{
"divergedRefs": {
"tag": true,
"state": "AHEAD",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"lastSync": 1331038800000,
"aheadRefs": {
"tag": true,
"state": "AHEAD",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"orphanedRefs": {
"tag": true,
"state": "AHEAD",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"available": true,
"enabled": true
}
Enables or disables synchronization for the specified repository. When synchronization is enabled, branches within the repository are immediately synchronized and the status is updated with the outcome. That initial synchronization is performed before the REST request returns, allowing it to return the updated status.
The authenticated user must have REPO_ADMIN permission for the specified repository. Anonymous users cannot manage synchronization, even on public repositories. Additionally, synchronization must be available for the specified repository. Synchronization is only available if:
string
Requiredstring
Requiredboolean
The updated synchronization status for the repository, after enabling synchronization. 204 NO CONTENT is returned instead after disabling synchronization.
1
2
3
4
5
6
7
curl --request POST \
--url 'http://{baseurl}/rest/sync/latest/projects/{projectKey}/repos/{repositorySlug}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"enabled": true
}'
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
{
"divergedRefs": {
"tag": true,
"state": "AHEAD",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"lastSync": 1331038800000,
"aheadRefs": {
"tag": true,
"state": "AHEAD",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"orphanedRefs": {
"tag": true,
"state": "AHEAD",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"available": true,
"enabled": true
}
Allows developers to apply a manual operation to bring a ref back in sync with upstream when it becomes out of sync due to conflicting changes. The following actions are supported:
The authenticated user must have REPO_WRITE permission for the specified repository. Anonymous users cannot synchronize refs, even on public repositories. Additionally, synchronization must be enabled and available for the specified repository.
string
Requiredstring
Requiredstring
Context
string
The requested action was successfully performed, and has updated the ref's state, but the ref if is still not in sync with upstream. For example, after applying the MERGE action, the ref will still be AHEAD of upstream. If the action brings the ref in sync with upstream, 204 NO CONTENT is returned instead.
1
2
3
4
5
6
7
8
9
10
11
curl --request POST \
--url 'http://{baseurl}/rest/sync/latest/projects/{projectKey}/repos/{repositorySlug}/synchronize' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"action": "MERGE",
"context": {
"commitMessage": "Merging in latest from upstream."
},
"refId": "refs/heads/master"
}'
1
2
3
4
5
6
7
{
"tag": true,
"state": "AHEAD",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
Retrieve a page of recently accessed repositories for the currently authenticated user.
Repositories are ordered from most recently to least recently accessed.
Only authenticated users may call this resource.
string
number
number
A page of recently accessed repositories.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/profile/recent/repos' \
--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
{
"values": [
{
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Streams an archive of the repository's contents at the requested commit. If no at=
commit is requested, an archive of the default branch is streamed.
The filename=
query parameter may be used to specify the exact filename to include in the "Content-Disposition" header. If an explicit filename is not provided, one will be automatically generated based on what is being archived. Its format depends on the at= value:
No at=
commit: <slug>-<default-branch-name>@<commit>.<format>; e.g. example-master@43c2f8a0fe8.zip
at=
sha: <slug>-<at>.<format>; e.g. example-09bcbb00100cfbb5310fb6834a1d5ce6cac253e9.tar.gz
at=
branchOrTag: <slug>-<branchOrTag>@<commit>.<format>; e.g. example-feature@bbb225f16e1.tar
Archives may be requested in the following formats by adding the format=
query parameter:
The contents of the archive may be filtered by using the path=
query parameter to specify paths to include. path=
may be specified multiple times to include multiple paths.
The prefix=
query parameter may be used to define a directory (or multiple directories) where the archive's contents should be placed. If the prefix does not end with /, one will be added automatically. The prefix is always treated as a directory; it is not possible to use it to prepend characters to the entries in the archive.
Archives of public repositories may be streamed by any authenticated or anonymous user. Streaming archives for non-public repositories requires an authenticated user with at least REPO_READ permission.
string
Requiredstring
Requiredstring
string
string
string
string
An archive or the requested commit, in zip, tar or gzipped-tar format.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/archive' \
--header 'Accept: application/json'
Retrieve the attachment.
The authenticated user must have REPO_READ permission for the specified repository that is associated to the attachment.
string
Requiredstring
Requiredstring
Requiredstring
the attachment
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}' \
--header 'Accept: application/json'
Delete an attachment.
The user must be authenticated and have REPO_ADMIN permission for the specified repository.
string
Requiredstring
Requiredstring
RequiredThis status code has no content.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}'
Retrieve the attachment metadata.
The authenticated user must have REPO_READ permission for the specified repository that is associated to the attachment that has the attachment metadata.
string
Requiredstring
Requiredstring
RequiredThe attachment metadata
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}/metadata' \
--header 'Accept: application/json'
1
2
3
4
5
{
"metadata": "{\\\"A\\\":\\\"B\\\"}",
"url": "test.com/test",
"id": 1
}
Save attachment metadata.
The authenticated user must have REPO_READ permission for the specified repository that is associated to the attachment that has the attachment metadata.
string
Requiredstring
Requiredstring
RequiredThe attachment metadata can be any valid JSON content
string
The attachment metadata
any
1
2
3
4
5
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}/metadata' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '"<string>"'
Delete attachment metadata.
The user must be authenticated and have REPO_ADMIN permission for the specified repository.
string
Requiredstring
Requiredstring
RequiredThis status code has no content.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}/metadata'
Retrieve the branches matching the supplied filterText param.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredboolean
string
boolean
string
string
number
number
The branches matching the supplied filterText.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"values": [
{
"displayId": "<string>",
"default": true,
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"id": "refs/heads/master"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Creates a branch using the information provided in the RestCreateBranchRequest request
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
string
Requiredstring
RequiredThe request to create a branch containing a name, startPoint, and optionally a message
string
string
string
The created branch.
1
2
3
4
5
6
7
8
9
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"message": "This is my branch or tag",
"name": "my-branch-or-tag",
"startPoint": "8d351a10fb428c0c1239530256e21cf24f136e73"
}'
1
2
3
4
5
6
7
{
"displayId": "<string>",
"default": true,
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"id": "refs/heads/master"
}
Retrieve a page of content for a file path at a specified revision.
Responses from this endpoint vary widely depending on the query parameters. The example JSON is for a request that does not use size, type, blame or noContent.
The various parameters are "processed" in the above order. That means ?size=true&type=truewill return a size response, not a type one; the type parameter will be ignored.
The blame and noContent query parameters are handled differently from size and type. For blame and noContent, the presence of the parameter implies "true" if no value is specified; size and and type both require an explicit=true or they're treated as "false".
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
string
string
string
A page of contents from a file.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse' \
--header 'Accept: application/json'
Retrieve a page of content for a file path at a specified revision.
Responses from this endpoint vary widely depending on the query parameters. The example JSON is for a request that does not use size, type, blame or noContent.
The various parameters are "processed" in the above order. That means ?size=true&type=truewill return a size response, not a type one; the type parameter will be ignored.
The blame and noContent query parameters are handled differently from size and type. For blame and noContent, the presence of the parameter implies "true" if no value is specified; size and and type both require an explicit=true or they're treated as "false".
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
A page of contents from a file.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse/{path}' \
--header 'Accept: application/json'
Update the content of path, on the given repository and branch.
This resource accepts PUT multipart form data, containing the file in a form-field named content.
An example curl request to update 'README.md' would be:
curl -X PUT -u username:password -F content=@README.md -F 'message=Updated using file-edit REST API' -F branch=master -F sourceCommitId=5636641a50b http://example.com/rest/api/latest/projects/PROJECT_1/repos/repo_1/browse/README.md
The file can be updated or created on a new branch. In this case, the sourceBranch parameter should be provided to identify the starting point for the new branch and the branch parameter identifies the branch to create the new commit on.
string
Requiredstring
Requiredstring
RequiredThe multipart form data containing the file
string
string
string
string
string
The newly created commit.
1
2
3
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse/{path}' \
--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
{
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
Retrieve a page of changes made in a specified commit.
Note: The implementation will apply a hard cap ({@code page.max.changes}) and it is not possible to request subsequent content when that cap is exceeded.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
number
number
A page of changes
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/changes' \
--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
{
"values": [
{
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"conflict": {
"ourChange": {
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"theirChange": {
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
}
},
"contentId": "abcdef0123abcdef4567abcdef8987abcdef6543",
"fromContentId": "bcdef0123abcdef4567abcdef8987abcdef6543a",
"percentUnchanged": 98,
"srcExecutable": true,
"nodeType": "DIRECTORY",
"executable": true,
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a page of commits from a given starting commit or "between" two commits. If no explicit commit is specified, the tip of the repository's default branch is assumed. commits may be identified by branch or tag name or by ID. A path may be supplied to restrict the returned commits to only those which affect that path.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
string
string
string
string
string
string
string
number
A page of commits
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits' \
--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
{
"values": [
{
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a single commit identified by its ID. In general, that ID is a SHA1. From 2.11, ref names like "refs/heads/master" are no longer accepted by this resource.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
A commit
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}' \
--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
{
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
Retrieve a page of changes made in a specified commit.
Note: The implementation will apply a hard cap (page.max.changes
) and it is not possible to request subsequent content when that cap is exceeded.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
number
number
A page of changes
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/changes' \
--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
{
"values": [
{
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"conflict": {
"ourChange": {
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"theirChange": {
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
}
},
"contentId": "abcdef0123abcdef4567abcdef8987abcdef6543",
"fromContentId": "bcdef0123abcdef4567abcdef8987abcdef6543a",
"percentUnchanged": 98,
"srcExecutable": true,
"nodeType": "DIRECTORY",
"executable": true,
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieves the commit discussion comments that match the specified search criteria.
It is possible to retrieve commit discussion comments that are anchored to a range of commits by providing the sinceId that the comments anchored from.
The authenticated user must have REPO_READ permission for the repository that the commit is in to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
number
number
A page of comments that match the search criteria
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments' \
--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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
{
"values": [
{
"pending": true,
"anchored": true,
"createdDate": 1359075920,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
},
"comments": [],
"severity": "NORMAL",
"anchor": {
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"fromRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"status": "UNAPPROVED",
"role": "AUTHOR",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"status": "UNAPPROVED",
"role": "AUTHOR",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"closed": true,
"title": "Talking Nerdy",
"toRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"version": 2154,
"locked": true,
"id": 1,
"state": "DECLINED",
"open": true
},
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"diffType": "COMMIT",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"updatedDate": 1449075920,
"text": "An insightful comment.",
"reply": true,
"html": "<string>",
"version": 1,
"parent": {
"pending": true,
"anchored": true,
"createdDate": 1359075920,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
},
"severity": "NORMAL",
"anchor": {
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"fromRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"status": "UNAPPROVED",
"role": "AUTHOR",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"status": "UNAPPROVED",
"role": "AUTHOR",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"closed": true,
"title": "Talking Nerdy",
"toRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"version": 2154,
"locked": true,
"id": 1,
"state": "DECLINED",
"open": true
},
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"diffType": "COMMIT",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"updatedDate": 1449075920,
"text": "An insightful comment.",
"reply": true,
"html": "<string>",
"version": 1,
"id": 1,
"state": "OPEN",
"properties": {}
},
"id": 1,
"state": "OPEN",
"properties": {}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Add a new comment.
Comments can be added in a few places by setting different attributes:
General commit comment:
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
"text": "An insightful general comment on a commit." } </pre> Reply to a comment: <pre>{ "text": "A measured reply.", "parent": { "id": 1 } } </pre> General file comment: <pre>{ "text": "An insightful general comment on a file.", "anchor": { "diffType": "COMMIT", "fromHash": "6df3858eeb9a53a911cd17e66a9174d44ffb02cd", "path": "path/to/file", "srcPath": "path/to/file", "toHash": "04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b" } } </pre> File line comment: <pre>{ "text": "A pithy comment on a particular line within a file.", "anchor": { "diffType": "COMMIT", "line": 1, "lineType": "CONTEXT", "fileType": "FROM", "fromHash": "6df3858eeb9a53a911cd17e66a9174d44ffb02cd", "path": "path/to/file", "srcPath": "path/to/file", "toHash": "04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b" } }
Note: general file comments are an experimental feature and may change in the near future!
For file and line comments, 'path' refers to the path of the file to which the comment should be applied and 'srcPath' refers to the path the that file used to have (only required for copies and moves). Also, fromHash and toHash refer to the sinceId / untilId (respectively) used to produce the diff on which the comment was added. Finally diffType refers to the type of diff the comment was added on.
For line comments, 'line' refers to the line in the diff that the comment should apply to. 'lineType' refers to the type of diff hunk, which can be:- 'ADDED' - for an added line;- 'REMOVED' - for a removed line; or- 'CONTEXT' - for a line that was unmodified but is in the vicinity of the diff.'fileType' refers to the file of the diff to which the anchor should be attached - which is of relevance when displaying the diff in a side-by-side way. Currently the supported values are:- 'FROM' - the source file of the diff- 'TO' - the destination file of the diffIf the current user is not a participant the user is added as one and updated to watch the commit.
The authenticated user must have REPO_READ permission for the repository that the commit is in to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
the comment
string
string
integer
integer
string
object
The newly created comment.
1
2
3
4
5
6
7
8
9
10
11
12
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"severity": "NORMAL",
"text": "An insightful comment.",
"version": 1,
"id": 1,
"state": "OPEN",
"properties": {}
}'
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
{
"pending": true,
"anchored": true,
"createdDate": 1359075920,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
},
"comments": [],
"severity": "NORMAL",
"anchor": {
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"fromRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"status": "UNAPPROVED",
"role": "AUTHOR",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"status": "UNAPPROVED",
"role": "AUTHOR",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"closed": true,
"title": "Talking Nerdy",
"toRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"version": 2154,
"locked": true,
"id": 1,
"state": "DECLINED",
"open": true
},
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"diffType": "COMMIT",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"updatedDate": 1449075920,
"text": "An insightful comment.",
"reply": true,
"html": "<string>",
"version": 1,
"parent": {
"pending": true,
"anchored": true,
"createdDate": 1359075920,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
},
"severity": "NORMAL",
"anchor": {
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"fromRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"status": "UNAPPROVED",
"role": "AUTHOR",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"status": "UNAPPROVED",
"role": "AUTHOR",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"closed": true,
"title": "Talking Nerdy",
"toRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"version": 2154,
"locked": true,
"id": 1,
"state": "DECLINED",
"open": true
},
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"diffType": "COMMIT",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"updatedDate": 1449075920,
"text": "An insightful comment.",
"reply": true,
"html": "<string>",
"version": 1,
"id": 1,
"state": "OPEN",
"properties": {}
},
"id": 1,
"state": "OPEN",
"properties": {}
}
Retrieves a commit discussion comment.
The authenticated user must have REPO_READ permission for the repository that the commit is in to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe requested comment.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}' \
--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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
{
"pending": true,
"anchored": true,
"createdDate": 1359075920,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
},
"comments": [],
"severity": "NORMAL",
"anchor": {
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"fromRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"status": "UNAPPROVED",
"role": "AUTHOR",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"status": "UNAPPROVED",
"role": "AUTHOR",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"closed": true,
"title": "Talking Nerdy",
"toRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"version": 2154,
"locked": true,
"id": 1,
"state": "DECLINED",
"open": true
},
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"diffType": "COMMIT",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"updatedDate": 1449075920,
"text": "An insightful comment.",
"reply": true,
"html": "<string>",
"version": 1,
"parent": {
"pending": true,
"anchored": true,
"createdDate": 1359075920,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
},
"severity": "NORMAL",
"anchor": {
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"fromRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"status": "UNAPPROVED",
"role": "AUTHOR",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"status": "UNAPPROVED",
"role": "AUTHOR",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"closed": true,
"title": "Talking Nerdy",
"toRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"version": 2154,
"locked": true,
"id": 1,
"state": "DECLINED",
"open": true
},
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"diffType": "COMMIT",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"updatedDate": 1449075920,
"text": "An insightful comment.",
"reply": true,
"html": "<string>",
"version": 1,
"id": 1,
"state": "OPEN",
"properties": {}
},
"id": 1,
"state": "OPEN",
"properties": {}
}
Update a comment, with the following restrictions:
Note: the supplied supplied JSON object must contain a version
that must match the server's version of the comment or the update will fail. To determine the current version of the comment, the comment should be fetched from the server prior to the update. Look for the 'version' attribute in the returned JSON structure.
The authenticated user must have REPO_READ permission for the repository that the commit is in to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe comment to update
string
string
integer
integer
string
object
The newly updated comment.
1
2
3
4
5
6
7
8
9
10
11
12
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"severity": "NORMAL",
"text": "An insightful comment.",
"version": 1,
"id": 1,
"state": "OPEN",
"properties": {}
}'
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
{
"pending": true,
"anchored": true,
"createdDate": 1359075920,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
},
"comments": [],
"severity": "NORMAL",
"anchor": {
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"fromRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"status": "UNAPPROVED",
"role": "AUTHOR",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"status": "UNAPPROVED",
"role": "AUTHOR",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"closed": true,
"title": "Talking Nerdy",
"toRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"version": 2154,
"locked": true,
"id": 1,
"state": "DECLINED",
"open": true
},
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"diffType": "COMMIT",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"updatedDate": 1449075920,
"text": "An insightful comment.",
"reply": true,
"html": "<string>",
"version": 1,
"parent": {
"pending": true,
"anchored": true,
"createdDate": 1359075920,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
},
"severity": "NORMAL",
"anchor": {
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"fromRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"status": "UNAPPROVED",
"role": "AUTHOR",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"status": "UNAPPROVED",
"role": "AUTHOR",
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
}
}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"closed": true,
"title": "Talking Nerdy",
"toRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"version": 2154,
"locked": true,
"id": 1,
"state": "DECLINED",
"open": true
},
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"diffType": "COMMIT",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"updatedDate": 1449075920,
"text": "An insightful comment.",
"reply": true,
"html": "<string>",
"version": 1,
"id": 1,
"state": "OPEN",
"properties": {}
},
"id": 1,
"state": "OPEN",
"properties": {}
}
Delete a commit comment. Anyone can delete their own comment. Only users with REPO_ADMIN and above may delete comments created by other users. Comments which have replies may not be deleted, regardless of the user's granted permissions.
The authenticated user must have REPO_READ permission for the repository that the commit is in to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
The operation was successful
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}'
string
Requiredstring
Requiredstring
Requiredinteger
string
boolean
string
string
default response
any
1
2
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diff'
Stream the diff between two provided revisions.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
A raw diff between two revisions
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diff/{path}' \
--header 'Accept: application/json'
Add the authenticated user as a watcher for the specified commit.
The authenticated user must have REPO_READ permission for the repository containing the commit to call this resource.
string
Requiredstring
Requiredstring
RequiredThe user is now watching the commit.
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/watch'
Remove the authenticated user as a watcher for the specified commit.
The authenticated user must have REPO_READ permission for the repository containing the commit to call this resource.
string
Requiredstring
Requiredstring
RequiredThe user is no longer watching the commit.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/watch'
Gets the file changes available in the from
commit but not in the to
commit.
If either the from
or to
commit are not specified, they will be replaced by the default branch of their containing repository.
string
Requiredstring
Requiredstring
string
string
number
number
A page of changes.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/changes' \
--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
{
"values": [
{
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"conflict": {
"ourChange": {
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"theirChange": {
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
}
},
"contentId": "abcdef0123abcdef4567abcdef8987abcdef6543",
"fromContentId": "bcdef0123abcdef4567abcdef8987abcdef6543a",
"percentUnchanged": 98,
"srcExecutable": true,
"nodeType": "DIRECTORY",
"executable": true,
"type": "ADD",
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Gets the commits accessible from the from
commit but not in the to
commit.
If either the from
or to
commit are not specified, they will be replaced by the default branch of their containing repository.
string
Requiredstring
Requiredstring
string
string
number
number
A page of commits.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/commits' \
--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
{
"values": [
{
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Gets a diff of the changes available in the from
commit but not in the to
commit.
If either the from
or to
commit are not specified, they will be replaced by the default branch of their containing repository.
string
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
string
number
number
The diff of the changes.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/diff{path}' \
--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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
{
"values": [
{
"lineComments": [
{
"pending": true,
"anchored": true,
"createdDate": 1359075920,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
},
"comments": [],
"severity": "NORMAL",
"anchor": {
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"fromRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"participants": [
{}
],
"reviewers": [
{}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"closed": true,
"title": "Talking Nerdy",
"toRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"version": 2154,
"locked": true,
"id": 1,
"state": "DECLINED",
"open": true
},
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"diffType": "COMMIT",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"updatedDate": 1449075920,
"text": "An insightful comment.",
"reply": true,
"html": "<string>",
"version": 1,
"parent": {
"pending": true,
"anchored": true,
"createdDate": 1359075920,
"author": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
},
"severity": "NORMAL",
"anchor": {
"pullRequest": {
"createdDate": 13590759200,
"closedDate": 19990759200,
"fromRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"participants": [
{}
],
"reviewers": [
{}
],
"description": "It is a kludge, but put the tuple from the database in the cache.",
"updatedDate": 14490759200,
"closed": true,
"title": "Talking Nerdy",
"toRef": {
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH"
},
"version": 2154,
"locked": true,
"id": 1,
"state": "DECLINED",
"open": true
},
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"diffType": "COMMIT",
"line": 98,
"path": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
}
},
"updatedDate": 1449075920,
"text": "An insightful comment.",
"reply": true,
"html": "<string>",
"version": 1,
"id": 1,
"state": "OPEN",
"properties": {}
},
"id": 1,
"state": "OPEN",
"properties": {}
}
],
"truncated": true,
"source": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"destination": {
"components": [
"path",
"to",
"file.txt"
],
"name": "file.txt",
"parent": "path/to",
"extension": "txt"
},
"binary": true,
"hunks": [
{
"sourceLine": 2154,
"sourceSpan": 2154,
"destinationLine": 2154,
"destinationSpan": 2154,
"segments": [
{}
],
"truncated": true,
"context": "<string>"
}
],
"properties": {}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Stream the raw diff between two provided revisions.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
string
string
string
A raw diff between two revisions.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/diff' \
--header 'Accept: application/json'
Stream the raw diff between two provided revisions.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
A raw diff between two revisions.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/diff/{path}' \
--header 'Accept: application/json'
Retrieve a page of files from particular directory of a repository. The search is done recursively, so all files from any sub-directory of the specified directory will be returned.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of files.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/files' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
{
"values": [],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a page of files from particular directory of a repository. The search is done recursively, so all files from any sub-directory of the specified directory will be returned.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
number
number
A page of files.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/files/{path}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
{
"values": [],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Return a page of hook scripts configured for the specified repository.
This endpoint requires REPO_ADMIN permission.
string
Requiredstring
Requirednumber
number
A page of hook scripts.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/hook-scripts' \
--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
{
"values": [
{
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"script": {
"createdDate": "<string>",
"description": "<string>",
"pluginKey": "<string>",
"updatedDate": "<string>",
"version": 2154,
"name": "<string>",
"id": 2154,
"type": "POST"
},
"triggerIds": [
"<string>"
]
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Creates/updates the hook script configuration for the provided hook script and repository.
This endpoint requires REPO_ADMIN permission.
string
Requiredstring
Requiredstring
RequiredThe hook triggers for which the hook script should be run
array<string>
The updated hook script.
1
2
3
4
5
6
7
8
9
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/hook-scripts/{scriptId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"triggerIds": [
"<string>"
]
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"script": {
"createdDate": "<string>",
"description": "<string>",
"pluginKey": "<string>",
"updatedDate": "<string>",
"version": 2154,
"name": "<string>",
"id": 2154,
"type": "POST"
},
"triggerIds": [
"<string>"
]
}
Removes the hook script from the set of hook scripts configured to run in the repository.
This endpoint requires REPO_ADMIN permission.
string
Requiredstring
Requiredstring
RequiredThe hook script was successfully deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/hook-scripts/{scriptId}'
Get all labels applied to the given repository.
The authenticated user must have REPO_READ permission for the specified repository.
string
Requiredstring
RequiredThe applied label.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/labels' \
--header 'Accept: application/json'
1
2
3
{
"name": "labelName"
}
Applies a label to the repository.
The authenticated user must have REPO_ADMIN permission for the specified repository.
string
Requiredstring
RequiredThe label to apply
string
The applied label.
1
2
3
4
5
6
7
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/labels' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"name": "labelName"
}'
1
2
3
{
"name": "labelName"
}
Remove label that is applied to the given repository.
The authenticated user must have REPO_ADMIN permission for the specified repository.
string
Requiredstring
Requiredstring
RequiredAn empty response indicating that the label is no longer associated to the repository.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/labels/{labelName}'
Streams files from the repository's root with the last commit to modify each file. Commit modifications are traversed starting from the at
commit or, if not specified, from the tip of the default branch.
Unless the repository is public, the authenticated user must have REPO_READ access to call this resource.
string
Requiredstring
Requiredstring
A map of files to the last commit that modified them, and the latest commit to the repository (by nature, any commit to a repository modifies its root).
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/last-modified' \
--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
{
"files": {
"pomXml": {
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
},
"readmeMd": {
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
},
"latestCommit": {
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
}
}
Streams files in the requested path
with the last commit to modify each file. Commit modifications are traversed starting from the at
commit or, if not specified, from the tip of the default branch.
Unless the repository is public, the authenticated user must have REPO_READ access to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
A map of files to the last commit that modified them, and the latest commit to update the requested path.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/last-modified/{path}' \
--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
{
"files": {
"pomXml": {
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
},
"readmeMd": {
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
},
"latestCommit": {
"committerTimestamp": 1449075830,
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"message": "More work on feature 1",
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
}
}
Retrieve the patch content for a repository at a specified revision.
Cache headers are added to the response (only if full commit hashes are used, not in the case of short hashes).
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
string
The patch contents from a repository.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/patch' \
--header 'Accept: application/json'
Retrieve the raw content for a file path at a specified revision.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
The raw contents from a file.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/raw/{path}' \
--header 'Accept: application/json'
Retrieve a page of repository ref change activity.
The authenticated user must have REPO_ADMIN permission to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of ref change activity.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/ref-change-activities' \
--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
{
"values": [
{
"refChange": {
"updatedType": "UNKNOWN",
"fromHash": "6053a1eaa1c009dd11092d09a72f3c41af1b59ad",
"toHash": "d6edcbf924697ab811a867421dab60d954ccad99",
"refId": "refs/heads/master",
"type": "ADD",
"ref": {
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
},
"trigger": "push",
"repository": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"createdDate": 19990759200,
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true,
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen"
},
"id": 1
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a page of branches with ref change activities for a specific repository.
The authenticated user must have REPO_ADMIN permission to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of branches with ref change activities.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/ref-change-activities/branches' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"values": [
{
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieves the auto decline settings for the supplied repository. Project settings will be returned if no explicit settings have been set for the repository. In the case that there are no project settings, the default settings will be returned.
The authenticated user must have REPO_READ permission for this repository to call the resource.
string
Requiredstring
RequiredThe auto decline settings
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-decline' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
{
"inactivityWeeks": 4,
"enabled": true,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
Creates or updates the auto decline settings for the supplied repository.
The authenticated user must have REPO_ADMIN permission for this repository to call the resource
string
Requiredstring
RequiredThe settings to create or update
boolean
integer
The auto decline settings
1
2
3
4
5
6
7
8
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-decline' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"enabled": true,
"inactivityWeeks": 4
}'
1
2
3
4
5
6
7
8
{
"inactivityWeeks": 4,
"enabled": true,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
Delete auto decline settings for the supplied repository.
The authenticated user must have REPO_ADMIN permission for this repository to call the resource.
string
Requiredstring
RequiredThe auto decline settings have been deleted successfully.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-decline'
Retrieve a page of repository hooks for this repository.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of repository hooks with their associated enabled state.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks' \
--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
{
"values": [
{
"configured": true,
"details": {
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"description": "<string>",
"version": "<string>",
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE"
},
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"enabled": true
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a repository hook for this repository.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe repository hooks with their associated enabled state for the supplied hookKey.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"configured": true,
"details": {
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"description": "<string>",
"version": "<string>",
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE"
},
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"enabled": true
}
Delete repository hook configuration for the supplied hookKey and repositorySlug
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe hook configuration matching the supplied hookKey and repositorySlug was deleted
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}'
Enable a repository hook for this repository and optionally apply new configuration.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
A JSON document may be provided to use as the settings for the hook. These structure and validity of the document is decided by the plugin providing the hook.
string
Requiredstring
Requiredstring
Requiredstring
The repository hooks with their associated enabled state for the supplied hookKey.
1
2
3
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/enabled' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"configured": true,
"details": {
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"description": "<string>",
"version": "<string>",
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE"
},
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"enabled": true
}
Disable a repository hook for this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe repository hooks with their associated enabled state for the supplied hookKey.
1
2
3
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/enabled' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"configured": true,
"details": {
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"description": "<string>",
"version": "<string>",
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE"
},
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"enabled": true
}
Retrieve the settings for a repository hook for this repository.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe settings for the hook.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/settings' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
{
"booleanValue": true,
"doubleValue": 1.1,
"integerValue": 1,
"longValue": -2147483648,
"stringValue": "This is an arbitrary string"
}
Modify the settings for a repository hook for this repository.
The service will reject any settings which are too large, the current limit is 32KB once serialized.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
A JSON document can be provided to use as the settings for the hook. These structure and validity of the document is decided by the plugin providing the hook.
string
Requiredstring
Requiredstring
RequiredThe raw settings.
boolean
number
integer
integer
string
The settings for the hook.
1
2
3
4
5
6
7
8
9
10
11
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/settings' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"booleanValue": true,
"doubleValue": 1.1,
"integerValue": 1,
"longValue": -2147483648,
"stringValue": "This is an arbitrary string"
}'
1
2
3
4
5
6
7
{
"booleanValue": true,
"doubleValue": 1.1,
"integerValue": 1,
"longValue": -2147483648,
"stringValue": "This is an arbitrary string"
}
Retrieve the pull request settings for the context repository.
The authenticated user must have REPO_READ permission for the context repository to call this resource.
This resource will call all RestFragments that are registered with the key bitbucket.repository.settings.pullRequests. If any fragment fails validations by returning a non-empty Map of errors, then no fragments will execute.
The property keys for the settings that are bundled with the application are
string
Requiredstring
RequiredThe repository pull request settings for the context repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requests' \
--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
{
"requiredAllTasksComplete": true,
"requiredApproversDeprecated": 2154,
"requiredSuccessfulBuilds": {
"count": "3",
"enabled": true
},
"requiredSuccessfulBuildsDeprecated": 2154,
"mergeConfig": {
"defaultStrategy": {
"description": "Always create a merge commit",
"flag": "--no-ff",
"enabled": true,
"name": "Merge commit",
"id": "no-ff"
},
"commitSummaries": 2154,
"strategies": [
{
"description": "Always create a merge commit",
"flag": "--no-ff",
"enabled": true,
"name": "Merge commit",
"id": "no-ff"
}
],
"type": "repository"
},
"requiredApprovers": {
"count": "3",
"enabled": true
},
"requiredAllApprovers": true
}
Update the pull request settings for the context repository.
The authenticated user must have REPO_ADMIN permission for the context repository to call this resource.
This resource will call all RestFragments that are registered with the key bitbucket.repository.settings.pullRequests. If any fragment fails validations by returning a non-empty Map of errors, then no fragments will execute.
Only the settings that should be updated need to be included in the request.
The property keys for the settings that are bundled with the application are
Merge strategy configuration deletion:
An explicitly set pull request merge strategy configuration can be deleted by POSTing a document with an empty "mergeConfig" attribute. i.e:
1 2 3
"mergeConfig": { } }
Upon completion of this request, the effective configuration will be:
string
Requiredstring
RequiredThe updated settings.
boolean
integer
object
integer
object
object
boolean
The repository pull request settings for the context 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
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requests' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"requiredAllTasksComplete": true,
"requiredApproversDeprecated": 2154,
"requiredSuccessfulBuilds": {
"count": "3",
"enabled": true
},
"requiredSuccessfulBuildsDeprecated": 2154,
"mergeConfig": {
"defaultStrategy": {
"id": "no-ff",
"links": {}
},
"commitSummaries": 2154,
"strategies": [
{
"id": "no-ff",
"links": {}
}
]
},
"requiredApprovers": {
"count": "3",
"enabled": true
},
"requiredAllApprovers": true
}'
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
{
"requiredAllTasksComplete": true,
"requiredApproversDeprecated": 2154,
"requiredSuccessfulBuilds": {
"count": "3",
"enabled": true
},
"requiredSuccessfulBuildsDeprecated": 2154,
"mergeConfig": {
"defaultStrategy": {
"description": "Always create a merge commit",
"flag": "--no-ff",
"enabled": true,
"name": "Merge commit",
"id": "no-ff"
},
"commitSummaries": 2154,
"strategies": [
{
"description": "Always create a merge commit",
"flag": "--no-ff",
"enabled": true,
"name": "Merge commit",
"id": "no-ff"
}
],
"type": "repository"
},
"requiredApprovers": {
"count": "3",
"enabled": true
},
"requiredAllApprovers": true
}
Retrieve the tags matching the supplied filterText param.
The authenticated user must have REPO_READ permission for the context repository to call this resource.
string
Requiredstring
Requiredstring
string
number
number
The tags matching the supplied filterText.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/tags' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"values": [
{
"hash": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Creates a tag using the information provided in the RestCreateTagRequest request
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
string
Requiredstring
RequiredThe request to create a tag containing a name, startPoint, and optionally a message
string
string
string
The created tag.
1
2
3
4
5
6
7
8
9
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/tags' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"message": "This is my branch or tag",
"name": "my-branch-or-tag",
"startPoint": "8d351a10fb428c0c1239530256e21cf24f136e73"
}'
1
2
3
4
5
6
7
8
{
"hash": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
Retrieve a tag in the specified repository.
The authenticated user must have REPO_READ permission for the context repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe tag which matches the supplied name.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/tags/{name}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
{
"hash": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
Add the authenticated user as a watcher for the specified repository.
The authenticated user must have REPO_READ permission for the repository to call this resource.
string
Requiredstring
RequiredThe repository to watch.
string
string
string
object
The user is now watching the repository.
1
2
3
4
5
6
7
8
9
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/watch' \
--header 'Content-Type: application/json' \
--data '{
"slug": "my-repo",
"scmId": "git",
"name": "My repo",
"links": {}
}'
Remove the authenticated user as a watcher for the specified repository.
The authenticated user must have REPO_READ permission for the repository to call this resource.
string
Requiredstring
RequiredThe user is no longer watching the repository.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/watch'
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
boolean
A page of webhooks.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks' \
--header 'Accept: application/json'
Create a webhook for the repository specified via the URL.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
RequiredThe webhook to be created for this repository.
array<string>
boolean
object
object
string
string
A created webhook.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"events": [
"<string>"
],
"active": true,
"statistics": {},
"configuration": {},
"url": "<string>",
"name": "<string>"
}'
1
2
3
4
5
6
7
8
9
{
"events": [
"<string>"
],
"active": true,
"configuration": {},
"url": "<string>",
"name": "<string>"
}
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
A webhook.
RestWebhookRequestResponse
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/test' \
--header 'Accept: application/json'
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
A webhook.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
{
"events": [
"<string>"
],
"active": true,
"configuration": {},
"url": "<string>",
"name": "<string>"
}
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe representation of the updated values for the webhook
array<string>
boolean
object
object
string
string
A webhook.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"events": [
"<string>"
],
"active": true,
"statistics": {},
"configuration": {},
"url": "<string>",
"name": "<string>"
}'
1
2
3
4
5
6
7
8
9
{
"events": [
"<string>"
],
"active": true,
"configuration": {},
"url": "<string>",
"name": "<string>"
}
Delete a webhook for the repository specified via the URL.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe webhook for the repository has been deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}'
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
A webhook invocation dataset.
RestDetailedInvocation
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/latest' \
--header 'Accept: application/json'
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
A webhook invocation dataset.
RestInvocationHistory
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/statistics' \
--header 'Accept: application/json'
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredA webhook invocation dataset.
RestInvocationHistory
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/statistics/summary' \
--header 'Accept: application/json'
Retrieve a page of repositories based on query parameters that control the search. See the documentation of the parameters for more details.
This resource is anonymously accessible.
Note on permissions. In absence of the permission
query parameter the implicit 'read' permission is assumed. Please note that this permission is lower than the REPO_READ permission rather than being equal to it. The implicit 'read' permission for a given repository is assigned to any user that has any of the higher permissions, such as REPO_READ, as well as to anonymous users if the repository is marked as public. The important implication of the above is that an anonymous request to this resource with a permission level REPO_READ is guaranteed to receive an empty list of repositories as a result. For anonymous requests it is therefore recommended to not specify the permission parameter at all.
string
string
string
string
string
string
string
number
number
A page of repositories.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/repos' \
--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
{
"values": [
{
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"origin": {
"project": {
"description": "The description for my cool project",
"namespace": "<string>",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"partition": 2154,
"relatedLinks": {},
"defaultBranch": "main",
"slug": "my-repo",
"scmId": "git",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Rate this page: