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
Requiredstring
string
JSON representation of the newly created branch
1
2
3
4
5
6
7
8
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 '{
"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
RequiredBranch delete request
boolean
string
string
An empty response indicating that the branch no longer exists in the repository
1
2
3
4
5
6
7
8
curl --request DELETE \
--url 'http://{baseurl}/rest/branch-utils/latest/projects/{projectKey}/repos/{repositorySlug}/branches' \
--header 'Content-Type: application/json' \
--data '{
"dryRun": true,
"endPoint": "<string>",
"name": "<string>"
}'
Gets the branch information associated with a single commit from a given repository.
string
Requiredstring
Requiredstring
Requirednumber
number
A page of branch refs associated with the commit
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'
Retrieves the default tasks for the supplied repository.
The authenticated user must have REPO_VIEW permission for this repository to call the resource.
string
Requiredstring
Requiredstring
number
number
A page of default tasks
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/default-tasks/latest/projects/{projectKey}/repos/{repositorySlug}/tasks' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"isLastPage": true,
"limit": 25,
"nextPageStart": 2154,
"size": 1,
"start": 2154,
"values": [
{
"description": "Default task description",
"id": 1
}
]
}
Creates a default task for the supplied repository.
The authenticated user must have REPO_ADMIN permission for this repository to call the resource.
string
Requiredstring
RequiredThe task to be added
string
object
object
The default task
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
curl --request POST \
--url 'http://{baseurl}/rest/default-tasks/latest/projects/{projectKey}/repos/{repositorySlug}/tasks' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"description": "Default task description",
"sourceMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
},
"targetMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
}
}'
1
2
3
4
{
"description": "Default task description",
"id": 1
}
Delete all the default tasks for the supplied repository
The authenticated user must have REPO_ADMIN permission for this repository to call the resource.
string
Requiredstring
RequiredThe default tasks have been deleted successfully.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/default-tasks/latest/projects/{projectKey}/repos/{repositorySlug}/tasks'
Updates a default task for the supplied repository.
The authenticated user must have REPO_ADMIN permission for this repository to call the resource.
string
Requiredstring
Requiredstring
RequiredThe task to be updated
string
object
object
The default task
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
curl --request PUT \
--url 'http://{baseurl}/rest/default-tasks/latest/projects/{projectKey}/repos/{repositorySlug}/tasks/{taskId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"description": "Default task description",
"sourceMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
},
"targetMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
}
}'
1
2
3
4
{
"description": "Default task description",
"id": 1
}
Delete a specific default task for a repository.
The authenticated user must have REPO_ADMIN permission for this repository to call the resource.
string
Requiredstring
Requiredstring
RequiredThe default task has been deleted successfully.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/default-tasks/latest/projects/{projectKey}/repos/{repositorySlug}/tasks/{taskId}'
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;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"force": true,
"message": "A new release tag",
"name": "release-tag",
"startPoint": "refs/heads/master",
"type": "ANNOTATED"
}'
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}'
Add an emoticon reaction to a comment
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
RequiredThe added reaction
1
2
3
curl --request PUT \
--url 'http://{baseurl}/rest/comment-likes/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}/reactions/{emoticon}' \
--header 'Accept: application/json;charset=UTF-8'
Remove an emoticon reaction from a comment
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
RequiredThe added reaction
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"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;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"action": "MERGE",
"context": {
"commitMessage": "Merging in latest from upstream."
},
"refId": "refs/heads/master"
}'
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;charset=UTF-8'
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/octet-stream'
Retrieve the attachment.
The authenticated user must have REPO_READ permission for the specified repository that is associated to the attachment.
Range requests (see IETF RFC7233) are supported. However only a single range issupported. If multiple ranges are passed the ranges will be ignored and the entire content will be returned in the response.
string
Requiredstring
Requiredstring
Requiredstring
string
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;charset=UTF-8'
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;charset=UTF-8' \
--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
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;charset=UTF-8'
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;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"message": "This is my branch or tag",
"name": "my-branch-or-tag",
"startPoint": "8d351a10fb428c0c1239530256e21cf24f136e73"
}'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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. fromHash will be resolved automatically as first parent if not specified. Note that this behaviour differs from /pull-requests/comments
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
integer
object
string
string
string
boolean
integer
The newly created comment.
1
2
3
4
5
6
7
8
9
10
11
12
13
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"properties": {},
"severity": "NORMAL",
"state": "OPEN",
"text": "An insightful comment.",
"threadResolved": true,
"version": 1
}'
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;charset=UTF-8'
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
integer
object
string
string
string
boolean
integer
The newly updated comment.
1
2
3
4
5
6
7
8
9
10
11
12
13
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"properties": {},
"severity": "NORMAL",
"state": "OPEN",
"text": "An insightful comment.",
"threadResolved": true,
"version": 1
}'
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}'
Retrieve the diff stats summary for a commit.
The stats summary include the total number of modified files, added lines, and deleted lines.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
string
string
string
The diff stats summary for a commit.
RestDiffStatsSummary
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diff-stats-summary/{path}' \
--header 'Accept: application/json;charset=UTF-8'
Retrieve the diff between two provided revisions.
To stream a raw text representation of the diff, this endpoint can be called with the request header 'Accept: text/plain'.
Note: This resource is currently not paged. The server will internally apply a hard cap to the streamed lines, and it is not possible to request subsequent pages if that cap is exceeded. In the event that the cap is reached, the diff will be cut short and one or more {@code truncated} flags will be set to true on the "segments", "hunks" and "diffs" properties, as well as the top-level object, in the returned JSON response.
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
string
string
string
string
A diff between two revisions.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diff/{path}' \
--header 'Accept: application/json;charset=UTF-8'
Returns the best common ancestor between two commits. If more than one best common ancestor exists, only one will be returned. It is unspecified which will be returned.
string
Requiredstring
Requiredstring
Requiredstring
The common ancestor of the two given commits
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/merge-base' \
--header 'Accept: application/json;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
Retrieve the diff stats summary 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
The diff stats summary for the changes.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/diff-stats-summary{path}' \
--header 'Accept: application/json;charset=UTF-8'
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
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;charset=UTF-8'
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: text/plain; qs=0.1'
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: text/plain; qs=0.1'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"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;charset=UTF-8'
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;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"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;charset=UTF-8'
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;charset=UTF-8'
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: text/plain'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"enabled": true,
"inactivityWeeks": 4
}'
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'
Retrieves the pull request auto-merge 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. If the repository's project has restricted its auto-merge settings, then the settings of the project will be returned.
The authenticated user must have REPO_READ permission for this repository to call the resource.
string
Requiredstring
RequiredThe pull request auto-merge settings
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-merge' \
--header 'Accept: application/json;charset=UTF-8'
Creates or updates the pull request auto-merge 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
The pull request auto-merge settings
1
2
3
4
5
6
7
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-merge' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"enabled": false
}'
Deletes pull request auto-merge settings for the supplied repository.
The authenticated user must have REPO_ADMIN permission for this repository to call the resource.
string
Requiredstring
RequiredThe pull request auto-merge settings
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-merge'
Retrieve a page of repository hooks for this repository.
The authenticated user must have REPO_ADMIN 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;charset=UTF-8'
Retrieve 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 GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}' \
--header 'Accept: application/json;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
Retrieve the settings for 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 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;charset=UTF-8'
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;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"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;charset=UTF-8'
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.
object
boolean
boolean
object
integer
object
integer
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
32
33
34
35
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requests' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"mergeConfig": {
"commitMessageTemplate": {
"body": "Merge in ${toProjectKey}/${toRepoSlug} from ${crossRepoProjectRepo}${fromRefName} to ${toRefName}",
"title": "Pull request #${id}: ${title}"
},
"commitSummaries": 2154,
"defaultStrategy": {
"id": "no-ff",
"links": {}
},
"strategies": [
{
"id": "no-ff",
"links": {}
}
]
},
"requiredAllApprovers": true,
"requiredAllTasksComplete": true,
"requiredApprovers": {
"count": "3",
"enabled": true
},
"requiredApproversDeprecated": 2154,
"requiredSuccessfulBuilds": {
"count": "3",
"enabled": true
},
"requiredSuccessfulBuildsDeprecated": 2154
}'
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;charset=UTF-8'
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;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"message": "This is my branch or tag",
"name": "my-branch-or-tag",
"startPoint": "8d351a10fb428c0c1239530256e21cf24f136e73"
}'
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;charset=UTF-8'
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
object
string
object
string
string
The user is now watching the repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/watch' \
--header 'Content-Type: application/json' \
--data '{
"defaultBranch": "main",
"links": {},
"name": "My repo",
"project": {
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
},
"scmId": "git",
"slug": "my-repo"
}'
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;charset=UTF-8'
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.
boolean
object
RestWebhookCredentials
array<string>
string
string
boolean
object
string
A created webhook.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"active": true,
"configuration": {},
"credentials": {
"password": "<string>",
"username": "<string>"
},
"events": [
"<string>"
],
"name": "<string>",
"scopeType": "<string>",
"sslVerificationRequired": true,
"statistics": {},
"url": "<string>"
}'
Search webhooks in this repository and parent project. This endpoint returns a superset of the results returned by the /webhooks endpoint because it allows filtering by project scope too, not just repository webhooks.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
boolean
A page of webhooks.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/search' \
--header 'Accept: application/json;charset=UTF-8'
Test connectivity to a specific endpoint.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredinteger
string
string
Basic authentication credentials, if required.
string
string
A webhook.
RestWebhookRequestResponse
1
2
3
4
5
6
7
8
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/test' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"password": "<string>",
"username": "<string>"
}'
Get a webhook by ID.
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;charset=UTF-8'
Update an existing webhook.
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
boolean
object
RestWebhookCredentials
array<string>
string
string
boolean
object
string
A webhook.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"active": true,
"configuration": {},
"credentials": {
"password": "<string>",
"username": "<string>"
},
"events": [
"<string>"
],
"name": "<string>",
"scopeType": "<string>",
"sslVerificationRequired": true,
"statistics": {},
"url": "<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}'
Get the latest invocations for a specific webhook.
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.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/latest' \
--header 'Accept: application/json;charset=UTF-8'
Get the statistics for a specific webhook.
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;charset=UTF-8'
Get the statistics summary for a specific webhook.
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;charset=UTF-8'
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, if anonymous access is enabled.
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;charset=UTF-8'
Rate this page: