Server
Bitbucket Data Center / / Modules
Operations
GET/api/latest/admin/bannerPUT/api/latest/admin/bannerDEL/api/latest/admin/bannerGET/api/latest/admin/clusterGET/api/latest/admin/default-branchPUT/api/latest/admin/default-branchDEL/api/latest/admin/default-branchGET/api/latest/admin/git/mesh/config/control-plane.pemGET/api/latest/admin/git/mesh/diagnostics/connectivityGET/api/latest/admin/git/mesh/nodesPOST/api/latest/admin/git/mesh/nodesGET/api/latest/admin/git/mesh/nodes/{id}PUT/api/latest/admin/git/mesh/nodes/{id}GET/api/latest/admin/git/mesh/support-zipsGET/api/latest/admin/git/mesh/support-zips/{id}GET/api/latest/admin/groupsPOST/api/latest/admin/groupsDEL/api/latest/admin/groupsPOST/api/latest/admin/groups/add-userPOST/api/latest/admin/groups/add-usersGET/api/latest/admin/groups/more-membersGET/api/latest/admin/groups/more-non-membersPOST/api/latest/admin/groups/remove-userGET/api/latest/admin/licensePOST/api/latest/admin/licenseGET/api/latest/admin/mail-serverPUT/api/latest/admin/mail-serverDEL/api/latest/admin/mail-serverGET/api/latest/admin/mail-server/sender-addressPUT/api/latest/admin/mail-server/sender-addressDEL/api/latest/admin/mail-server/sender-addressGET/api/latest/admin/permissions/groupsPUT/api/latest/admin/permissions/groupsDEL/api/latest/admin/permissions/groupsGET/api/latest/admin/permissions/groups/noneGET/api/latest/admin/permissions/usersPUT/api/latest/admin/permissions/usersDEL/api/latest/admin/permissions/usersGET/api/latest/admin/permissions/users/noneGET/api/latest/admin/pull-requests/{scmId}POST/api/latest/admin/pull-requests/{scmId}GET/api/latest/admin/rate-limit/historyGET/api/latest/admin/rate-limit/settingsPUT/api/latest/admin/rate-limit/settingsGET/api/latest/admin/rate-limit/settings/usersPOST/api/latest/admin/rate-limit/settings/usersGET/api/latest/admin/rate-limit/settings/users/{userSlug}PUT/api/latest/admin/rate-limit/settings/users/{userSlug}DEL/api/latest/admin/rate-limit/settings/users/{userSlug}GET/api/latest/admin/usersPUT/api/latest/admin/usersPOST/api/latest/admin/usersDEL/api/latest/admin/usersPOST/api/latest/admin/users/add-groupPOST/api/latest/admin/users/add-groupsDEL/api/latest/admin/users/captchaPUT/api/latest/admin/users/credentialsGET/api/latest/admin/users/erasurePOST/api/latest/admin/users/erasureGET/api/latest/admin/users/more-membersGET/api/latest/admin/users/more-non-membersPOST/api/latest/admin/users/remove-groupPOST/api/latest/admin/users/renameGET/api/latest/application-propertiesGET/api/latest/build/capabilitiesGET/api/latest/dashboard/pull-request-suggestionsGET/api/latest/dashboard/pull-requestsGET/api/latest/deployment/capabilitiesGET/api/latest/groupsPOST/api/latest/hook-scriptsGET/api/latest/hook-scripts/{scriptId}PUT/api/latest/hook-scripts/{scriptId}DEL/api/latest/hook-scripts/{scriptId}GET/api/latest/hook-scripts/{scriptId}/contentGET/api/latest/hooks/{hookKey}/avatarGET/api/latest/inbox/pull-requestsGET/api/latest/inbox/pull-requests/countGET/api/latest/labelsGET/api/latest/labels/{labelName}GET/api/latest/labels/{labelName}/labeledGET/api/latest/logs/logger/{loggerName}PUT/api/latest/logs/logger/{loggerName}/{levelName}GET/api/latest/logs/rootLoggerPUT/api/latest/logs/rootLogger/{levelName}POST/api/latest/markup/previewPOST/api/latest/migration/exportsPOST/api/latest/migration/exports/previewGET/api/latest/migration/exports/{jobId}POST/api/latest/migration/exports/{jobId}/cancelGET/api/latest/migration/exports/{jobId}/messagesPOST/api/latest/migration/importsGET/api/latest/migration/imports/{jobId}POST/api/latest/migration/imports/{jobId}/cancelGET/api/latest/migration/imports/{jobId}/messagesPOST/api/latest/migration/meshPOST/api/latest/migration/mesh/previewGET/api/latest/migration/mesh/reposGET/api/latest/migration/mesh/summariesGET/api/latest/migration/mesh/summaryGET/api/latest/migration/mesh/{jobId}POST/api/latest/migration/mesh/{jobId}/cancelGET/api/latest/migration/mesh/{jobId}/messagesGET/api/latest/migration/mesh/{jobId}/summaryGET/api/latest/profile/recent/reposGET/api/latest/projectsPOST/api/latest/projectsGET/api/latest/projects/{projectKey}PUT/api/latest/projects/{projectKey}DEL/api/latest/projects/{projectKey}GET/api/latest/projects/{projectKey}/avatar.pngPOST/api/latest/projects/{projectKey}/avatar.pngGET/api/latest/projects/{projectKey}/hook-scriptsPUT/api/latest/projects/{projectKey}/hook-scripts/{scriptId}DEL/api/latest/projects/{projectKey}/hook-scripts/{scriptId}DEL/api/latest/projects/{projectKey}/permissionsGET/api/latest/projects/{projectKey}/permissions/groupsPUT/api/latest/projects/{projectKey}/permissions/groupsDEL/api/latest/projects/{projectKey}/permissions/groupsGET/api/latest/projects/{projectKey}/permissions/groups/noneGET/api/latest/projects/{projectKey}/permissions/usersPUT/api/latest/projects/{projectKey}/permissions/usersDEL/api/latest/projects/{projectKey}/permissions/usersGET/api/latest/projects/{projectKey}/permissions/users/noneGET/api/latest/projects/{projectKey}/permissions/{permission}/allPOST/api/latest/projects/{projectKey}/permissions/{permission}/allGET/api/latest/projects/{projectKey}/reposPOST/api/latest/projects/{projectKey}/reposGET/api/latest/projects/{projectKey}/repos/{repositorySlug}PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}POST/api/latest/projects/{projectKey}/repos/{repositorySlug}DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/archiveGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}/metadataPUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}/metadataDEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}/metadataGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/branchesPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/branchesGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches/defaultPUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches/defaultGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/browseGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse/{path}PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse/{path}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/changesGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commitsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/buildsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/buildsDEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/buildsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/changesGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/commentsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/commentsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/deploymentsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/deploymentsDEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/deploymentsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diffGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diff/{path}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/pull-requestsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/watchDEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/watchGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/changesGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/commitsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/diff{path}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/contributingHEAD/api/latest/projects/{projectKey}/repos/{repositorySlug}/contributingGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/default-branchPUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/default-branchGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/diffGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/diff/{path}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/filesGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/files/{path}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/forksGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/hook-scriptsPUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/hook-scripts/{scriptId}DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/hook-scripts/{scriptId}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/labelsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/labelsDEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/labels/{labelName}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/last-modifiedGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/last-modified/{path}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/licenseHEAD/api/latest/projects/{projectKey}/repos/{repositorySlug}/licenseGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/participantsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/patchDEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissionsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groupsPUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groupsDEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groupsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groups/noneGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/usersPUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/usersDEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/usersGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/users/noneGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requestsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requestsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}.diffGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}.patchGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/activitiesPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/approveDEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/approveGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-commentsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-commentsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/changesGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commentsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commentsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}/apply-suggestionGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commitsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/declineGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diffGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff/{path}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/mergePOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/mergeGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participantsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participantsDEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participantsPUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug}DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug}POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reopenGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reviewPUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reviewDEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reviewGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/tasksGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/tasks/countPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watchDEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watchGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/rawGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/raw/{path}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/readmeHEAD/api/latest/projects/{projectKey}/repos/{repositorySlug}/readmePOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/recreateGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/ref-change-activitiesGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/ref-change-activities/branchesGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/relatedGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-declinePUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-declineDEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-declineGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooksGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/enabledDEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/enabledGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/settingsPUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/settingsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requestsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requestsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groupsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groupsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}/usersGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/tagsPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/tagsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/tags/{name}POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/watchDEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/watchGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooksPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooksPOST/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/testGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/latestGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/statisticsGET/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/statistics/summaryGET/api/latest/projects/{projectKey}/settings/auto-declinePUT/api/latest/projects/{projectKey}/settings/auto-declineDEL/api/latest/projects/{projectKey}/settings/auto-declineGET/api/latest/projects/{projectKey}/settings/hooksGET/api/latest/projects/{projectKey}/settings/hooks/{hookKey}PUT/api/latest/projects/{projectKey}/settings/hooks/{hookKey}/enabledDEL/api/latest/projects/{projectKey}/settings/hooks/{hookKey}/enabledGET/api/latest/projects/{projectKey}/settings/hooks/{hookKey}/settingsPUT/api/latest/projects/{projectKey}/settings/hooks/{hookKey}/settingsGET/api/latest/projects/{projectKey}/settings/pull-requests/{scmId}POST/api/latest/projects/{projectKey}/settings/pull-requests/{scmId}GET/api/latest/projects/{projectKey}/settings/reviewer-groupsPOST/api/latest/projects/{projectKey}/settings/reviewer-groupsGET/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}PUT/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}DEL/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}GET/api/latest/reposPOST/api/latest/tasksGET/api/latest/tasks/{taskId}PUT/api/latest/tasks/{taskId}DEL/api/latest/tasks/{taskId}GET/api/latest/usersPUT/api/latest/usersPUT/api/latest/users/credentialsGET/api/latest/users/{userSlug}POST/api/latest/users/{userSlug}/avatar.pngDEL/api/latest/users/{userSlug}/avatar.pngGET/api/latest/users/{userSlug}/settingsPOST/api/latest/users/{userSlug}/settings
GET

Get api latest admin banner

Gets the announcement banner, if one exists and is available to the user

Request

This request has no parameters.

Responses

The requested banner

application/json

RestAnnouncementBanner
GET/api/latest/admin/banner
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/banner' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 { "audience": "AUTHENTICATED", "message": "<string>", "enabled": true }
PUT

Put api latest admin banner

Sets the announcement banner with the provided JSON. Only users authenticated as Admins may call this resource

Request

Request bodyapplication/json

audience

string

Required
enabled

boolean

message

string

Responses

The banner was set successfully

PUT/api/latest/admin/banner
1 2 3 4 5 6 7 8 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/admin/banner' \ --header 'Content-Type: application/json' \ --data '{ "audience": "AUTHENTICATED", "enabled": true, "message": "<string>" }'
DEL

Delete api latest admin banner

Deletes a banner, if one is present in the database.

Request

This request has no parameters.

Responses

The query executed successfully, whether a banner was deleted or not

DEL/api/latest/admin/banner
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/admin/banner'
GET

Get api latest admin cluster

Gets information about the nodes that currently make up the stash cluster.

The authenticated user must have the SYS_ADMIN permission to call this resource.

Request

This request has no parameters.

Responses

A response containing information about the cluster

application/json

RestClusterInformation
GET/api/latest/admin/cluster
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/cluster' \ --header 'Accept: application/json'
200Response
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 { "localNode": { "buildVersion": "7.0.0", "name": "foo", "id": "d4fde8b1-2504-4998-a0ba-14fbe98edd4d", "address": { "address": "node.example.com", "port": 8230 }, "local": true }, "running": true, "nodes": [ { "buildVersion": "7.0.0", "name": "foo", "id": "d4fde8b1-2504-4998-a0ba-14fbe98edd4d", "address": { "address": "node.example.com", "port": 8230 }, "local": true } ] }
GET

Get api latest admin default-branch

Retrieves the configured global default branch, which is used when creating new repositories if an explicit default branch is not specified. The user must be authenticated to call this resource.

Request

This request has no parameters.

Responses

The configured global default branch.

application/json

any

GET/api/latest/admin/default-branch
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/default-branch' \ --header 'Accept: application/json'
PUT

Put api latest admin default-branch

Configures the global default branch, which is used when creating new repositories if an explicit default branch is not specified.

The authenticated user must have ADMIN permission to call this resource.

Request

Request bodyapplication/json

id

string

Responses

The default branch has been set.

PUT/api/latest/admin/default-branch
1 2 3 4 5 6 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/admin/default-branch' \ --header 'Content-Type: application/json' \ --data '{ "id": "<string>" }'
DEL

Delete api latest admin default-branch

Clears the global default branch, which is used when creating new repositories if an explicit default branch is not specified, if one has been configured.

The authenticated user must have ADMIN permission to call this resource.

Request

This request has no parameters.

Responses

The default branch has been cleared.

DEL/api/latest/admin/default-branch
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/admin/default-branch'
GET

Get api latest admin git mesh config control-plane.pem

Obtain the control plane PEM.

The authenticated user must have SYS_ADMIN permission.

Request

This request has no parameters.

Responses

The control plane PEM.

text/plain

any

GET/api/latest/admin/git/mesh/config/control-plane.pem
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/git/mesh/config/control-plane.pem' \ --header 'Accept: text/plain'
GET

Get api latest admin git mesh diagnostics connectivity

Generates a connectivity report between the Bitbucket node(s) and the Mesh node(s).

The authenticated user must have SYS_ADMIN permission.

Request

This request has no parameters.

Responses

The connectivity report between the Bitbucket node(s) and Mesh node(s).

application/json

RestMeshConnectivityReport
GET/api/latest/admin/git/mesh/diagnostics/connectivity
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/git/mesh/diagnostics/connectivity' \ --header 'Accept: application/json'
200Response
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 { "reports": [ { "summaries": [ { "summary": { "reachable": true, "roundTripTime": 100, "errorMessage": "Unable to connect to the node." }, "node": { "name": "My Node", "id": "1", "type": "BITBUCKET" } } ], "node": { "name": "My Node", "id": "1", "type": "BITBUCKET" } } ] }
GET

Get api latest admin git mesh nodes

Get all the registered Mesh nodes.

The authenticated user must have SYS_ADMIN permission.

Request

This request has no parameters.

Responses

The list of registered Mesh nodes.

application/json

RestMeshNode
GET/api/latest/admin/git/mesh/nodes
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/git/mesh/nodes' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 { "rpcUrl": "http://127.0.0.1:7999", "lastSeenDate": 1630041546433, "rpcId": "1", "name": "My node", "id": "1", "offline": false }
POST

Post api latest admin git mesh nodes

Register a new Mesh node.

The authenticated user must have SYS_ADMIN permission.

Request

Request bodyapplication/json

The request specifying the new Mesh node.

rpcUrl

string

lastSeenDate

number

rpcId

string

name

string

id

string

offline

boolean

Responses

The newly registered Mesh node.

application/json

RestMeshNode
POST/api/latest/admin/git/mesh/nodes
1 2 3 4 5 6 7 8 9 10 11 12 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/admin/git/mesh/nodes' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "rpcUrl": "http://127.0.0.1:7999", "lastSeenDate": 1630041546433, "rpcId": "1", "name": "My node", "id": "1", "offline": false }'
200Response
1 2 3 4 5 6 7 8 { "rpcUrl": "http://127.0.0.1:7999", "lastSeenDate": 1630041546433, "rpcId": "1", "name": "My node", "id": "1", "offline": false }
GET

Get api latest admin git mesh nodes {id}

Get the registered Mesh node that matches the supplied ID.

The authenticated user must have SYS_ADMIN permission.

Request

Path parameters

id

string

Required

Responses

The Mesh node that matches the ID.

application/json

RestMeshNode
GET/api/latest/admin/git/mesh/nodes/{id}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/git/mesh/nodes/{id}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 { "rpcUrl": "http://127.0.0.1:7999", "lastSeenDate": 1630041546433, "rpcId": "1", "name": "My node", "id": "1", "offline": false }
PUT

Put api latest admin git mesh nodes {id}

Update a Mesh node.

The authenticated user must have SYS_ADMIN permission.

Request

Path parameters

id

string

Required

Request bodyapplication/json

The request specifying the updated Mesh node.

rpcUrl

string

lastSeenDate

number

rpcId

string

name

string

id

string

offline

boolean

Responses

The updated Mesh node.

application/json

RestMeshNode
PUT/api/latest/admin/git/mesh/nodes/{id}
1 2 3 4 5 6 7 8 9 10 11 12 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/admin/git/mesh/nodes/{id}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "rpcUrl": "http://127.0.0.1:7999", "lastSeenDate": 1630041546433, "rpcId": "1", "name": "My node", "id": "1", "offline": false }'
200Response
1 2 3 4 5 6 7 8 { "rpcUrl": "http://127.0.0.1:7999", "lastSeenDate": 1630041546433, "rpcId": "1", "name": "My node", "id": "1", "offline": false }
GET

Get api latest admin git mesh support-zips

Get the support zips for all the Mesh nodes.

The authenticated user must have SYS_ADMIN permission.

Request

This request has no parameters.

Responses

The support zips for all the Mesh nodes.

application/octet-stream

any

GET/api/latest/admin/git/mesh/support-zips
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/git/mesh/support-zips' \ --header 'Accept: application/octet-stream'
GET

Get api latest admin git mesh support-zips {id}

Get the support zip for the Mesh node that matches the specified ID.

The authenticated user must have SYS_ADMIN permission.

Request

Path parameters

id

string

Required

Responses

The support zip for the Mesh node that matches the ID.

application/octet-stream

any

GET/api/latest/admin/git/mesh/support-zips/{id}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/git/mesh/support-zips/{id}' \ --header 'Accept: application/octet-stream'
GET

Get api latest admin groups

Retrieve a page of groups.

The authenticated user must have LICENSED_USER permission or higher to call this resource.

Request

Query parameters

filter

string

start

number

limit

number

Responses

A page of groups.

application/json

object
GET/api/latest/admin/groups
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/groups' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 { "values": [ { "deletable": true, "name": "group-a" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest admin groups

Create a new group.

The authenticated user must have ADMIN permission or higher to call this resource.

Request

Query parameters

name

string

Required

Responses

The newly created group.

application/json

RestDetailedGroup
POST/api/latest/admin/groups
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/admin/groups?name={name}' \ --header 'Accept: application/json'
200Response
1 2 3 4 { "deletable": true, "name": "group-a" }
DEL

Delete api latest admin groups

Deletes the specified group, removing them from the system. This also removes any permissions that may have been granted to the group.

A user may not delete the last group that is granting them administrative permissions, or a group with greater permissions than themselves.

The authenticated user must have the ADMIN permission to call this resource.

Request

Query parameters

name

string

Required

Responses

The deleted group.

application/json

RestDetailedGroup
DEL/api/latest/admin/groups
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/admin/groups?name={name}' \ --header 'Accept: application/json'
200Response
1 2 3 4 { "deletable": true, "name": "group-a" }
POST

Post api latest admin groups add-userDeprecated

Deprecated since 2.10. Use /rest/users/add-groups instead.

Add a user to a group.

In the request entity, the context attribute is the group and the itemName is the user.

The authenticated user must have the ADMIN permission to call this resource.

Request

Request bodyapplication/json

context

string

itemName

string

Responses

The user was added to the group.

application/json

any

POST/api/latest/admin/groups/add-user
1 2 3 4 5 6 7 8 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/admin/groups/add-user' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "context": "group_a", "itemName": "user_a" }'
POST

Post api latest admin groups add-users

Add multiple users to a group.

The authenticated user must have the ADMIN permission to call this resource.

Request

Request bodyapplication/json

group

string

users

array<string>

Required

Responses

All the users were added to the group

application/json

any

POST/api/latest/admin/groups/add-users
1 2 3 4 5 6 7 8 9 10 11 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/admin/groups/add-users' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "group": "group", "users": [ "user1", "user2" ] }'
GET

Get api latest admin groups more-members

Retrieves a list of users that are members of a specified group.

The authenticated user must have the LICENSED_USER permission to call this resource.

Request

Query parameters

filter

string

context

string

Required
start

number

limit

number

Responses

A page of users.

application/json

object
GET/api/latest/admin/groups/more-members
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/groups/more-members?context={context}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 { "values": [ { "directoryName": "Bitbucket Internal Directory", "lastAuthenticationTimestamp": 1368145580548, "mutableDetails": true, "mutableGroups": true, "deletable": true, "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest admin groups more-non-members

Retrieves a list of users that are not members of a specified group.

The authenticated user must have the LICENSED_USER permission to call this resource.

Request

Query parameters

filter

string

context

string

Required
start

number

limit

number

Responses

A page of users.

application/json

object
GET/api/latest/admin/groups/more-non-members
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/groups/more-non-members?context={context}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 { "values": [ { "directoryName": "Bitbucket Internal Directory", "lastAuthenticationTimestamp": 1368145580548, "mutableDetails": true, "mutableGroups": true, "deletable": true, "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest admin groups remove-userDeprecated

Deprecated since 2.10. Use /rest/users/remove-groups instead.

Remove a user from a group.

The authenticated user must have the ADMIN permission to call this resource.

In the request entity, the context attribute is the group and the itemName is the user.

Request

Request bodyapplication/json

context

string

itemName

string

Responses

The user was removed from the group.

application/json

any

POST/api/latest/admin/groups/remove-user
1 2 3 4 5 6 7 8 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/admin/groups/remove-user' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "context": "group_a", "itemName": "user_a" }'
GET

Get api latest admin license

Retrieves details about the current license, as well as the current status of the system with regards to the installed license. The status includes the current number of users applied toward the license limit, as well as any status messages about the license (warnings about expiry or user counts exceeding license limits).

The authenticated user must have ADMIN permission. Unauthenticated users, and non-administrators, are not permitted to access license details.

Request

This request has no parameters.

Responses

The currently-installed license.

application/json

RestBitbucketLicense
GET/api/latest/admin/license
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/license' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "serverId": "<server ID embedded in license>", "creationDate": 1331038800000, "daysBeforeExpiry": 2154, "expiryDate": 1372493732817, "gracePeriodEndDate": 1372493732817, "maintenanceExpiryDate": 1372493732817, "maximumNumberOfUsers": 12, "numberOfDaysBeforeExpiry": 2154, "numberOfDaysBeforeGracePeriodExpiry": 2154, "numberOfDaysBeforeMaintenanceExpiry": 2154, "purchaseDate": 1331038800000, "supportEntitlementNumber": "<support entitlement number embedded in license>", "unlimitedNumberOfUsers": true, "status": { "serverId": "<actual server ID>", "currentNumberOfUsers": 2 }, "license": "<encoded license text>" }
POST

Post api latest admin license

Decodes the provided encoded license and sets it as the active license. If no license was provided, a 400 is returned. If the license cannot be decoded, or cannot be applied, a 409 is returned. Some possible reasons a license may not be applied include:

  • It is for a different product
  • It is already expired

Otherwise, if the license is updated successfully, details for the new license are returned with a 200 response.

Warning: It is possible to downgrade the license during update, applying a license with a lower number of permitted users. If the number of currently-licensed users exceeds the limits of the new license, pushing will be disabled until the licensed user count is brought into compliance with the new license.

The authenticated user must have SYS_ADMIN permission. ADMIN users may view the current license details, but they may not update the license.

Request

Request bodyapplication/json

a JSON payload containing the encoded license to apply

license

string

Responses

The newly-installed license.

application/json

RestBitbucketLicense
POST/api/latest/admin/license
1 2 3 4 5 6 7 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/admin/license' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "license": "<encoded license text>" }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "serverId": "<server ID embedded in license>", "creationDate": 1331038800000, "daysBeforeExpiry": 2154, "expiryDate": 1372493732817, "gracePeriodEndDate": 1372493732817, "maintenanceExpiryDate": 1372493732817, "maximumNumberOfUsers": 12, "numberOfDaysBeforeExpiry": 2154, "numberOfDaysBeforeGracePeriodExpiry": 2154, "numberOfDaysBeforeMaintenanceExpiry": 2154, "purchaseDate": 1331038800000, "supportEntitlementNumber": "<support entitlement number embedded in license>", "unlimitedNumberOfUsers": true, "status": { "serverId": "<actual server ID>", "currentNumberOfUsers": 2 }, "license": "<encoded license text>" }
GET

Get api latest admin mail-server

Retrieves the current mail configuration.

The authenticated user must have the SYS_ADMIN permission to call this resource.

Request

This request has no parameters.

Responses

The mail configuration

application/json

RestMailConfiguration
GET/api/latest/admin/mail-server
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/mail-server' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 { "senderAddress": "stash-no-reply@company.com", "hostname": "smtp.example.com", "requireStartTls": true, "useStartTls": true, "port": 465, "protocol": "SMTP", "password": "password", "username": "user" }
PUT

Put api latest admin mail-server

Updates the mail configuration.

The authenticated user must have the SYS_ADMIN permission to call this resource.

Request

Request bodyapplication/json

hostname

string

password

string

port

integer

protocol

string

requireStartTls

boolean

senderAddress

string

useStartTls

boolean

username

string

Responses

The updated mail configuration.

application/json

RestMailConfiguration
PUT/api/latest/admin/mail-server
1 2 3 4 5 6 7 8 9 10 11 12 13 14 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/admin/mail-server' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "hostname": "smtp.example.com", "password": "password", "port": 465, "protocol": "SMTP", "requireStartTls": true, "senderAddress": "stash-no-reply@company.com", "useStartTls": true, "username": "user" }'
200Response
1 2 3 4 5 6 7 8 9 10 { "senderAddress": "stash-no-reply@company.com", "hostname": "smtp.example.com", "requireStartTls": true, "useStartTls": true, "port": 465, "protocol": "SMTP", "password": "password", "username": "user" }
DEL

Delete api latest admin mail-server

Deletes the current mail configuration.

The authenticated user must have the SYS_ADMIN permission to call this resource.

Request

This request has no parameters.

Responses

The mail configuration was successfully deleted.

DEL/api/latest/admin/mail-server
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/admin/mail-server'
GET

Get api latest admin mail-server sender-address

Retrieves the server email address

Request

This request has no parameters.

Responses

The server email address

application/json

any

GET/api/latest/admin/mail-server/sender-address
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/mail-server/sender-address' \ --header 'Accept: application/json'
PUT

Put api latest admin mail-server sender-address

Updates the server email address

The authenticated user must have the ADMIN permission to call this resource.

Request

Request bodyapplication/json

string

Responses

The from address used in notification emails

application/json

any

PUT/api/latest/admin/mail-server/sender-address
1 2 3 4 5 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/admin/mail-server/sender-address' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '"<string>"'
DEL

Delete api latest admin mail-server sender-address

Clears the server email address.

The authenticated user must have the ADMIN permission to call this resource.

Request

This request has no parameters.

Responses

he server email address was successfully cleared.

DEL/api/latest/admin/mail-server/sender-address
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/admin/mail-server/sender-address'
GET

Get api latest admin permissions groups

Retrieve a page of groups that have been granted at least one global permission.

The authenticated user must have ADMIN permission or higher to call this resource.

Request

Query parameters

filter

string

start

number

limit

number

Responses

A page of groups and their highest global permissions.

application/json

object
GET/api/latest/admin/permissions/groups
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/permissions/groups' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "values": [ { "permission": "ADMIN", "group": { "name": "group_a" } } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
PUT

Put api latest admin permissions groups

Promote or demote a user's global permission level. Available global permissions are:

  • LICENSED_USER
  • PROJECT_CREATE
  • ADMIN
  • SYS_ADMIN

See the Bitbucket Server documentation for a detailed explanation of what each permission entails.

The authenticated user must have:

  • ADMIN permission or higher; and
  • the permission they are attempting to grant or higher; and
  • greater or equal permissions than the current permission level of the group (a user may not demote the permission level of a group with higher permissions than them)

to call this resource. In addition, a user may not demote a group's permission level if their own permission level would be reduced as a result.

Request

Query parameters

name

array<string>

Required
permission

string

Required

Responses

The specified permission was granted to the specified user.

PUT/api/latest/admin/permissions/groups
1 2 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/admin/permissions/groups?name={name}&permission={permission}'
DEL

Delete api latest admin permissions groups

Revoke all global permissions for a group.

The authenticated user must have:

  • ADMIN permission or higher; and
  • greater or equal permissions than the current permission level of the group (a user may not demote the permission level of a group with higher permissions than them)

to call this resource. In addition, a user may not revoke a group's permissions if their own permission level would be reduced as a result.

Request

Query parameters

name

string

Required

Responses

All global permissions were revoked from the group.

DEL/api/latest/admin/permissions/groups
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/admin/permissions/groups?name={name}'
GET

Get api latest admin permissions groups none

Retrieve a page of groups that have no granted global permissions.

The authenticated user must have ADMIN permission or higher to call this resource.

Request

Query parameters

filter

string

start

number

limit

number

Responses

A page of groups that have not been granted any global permissions.

application/json

object
GET/api/latest/admin/permissions/groups/none
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/permissions/groups/none' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 { "values": [ { "deletable": true, "name": "group-a" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest admin permissions users

Retrieve a page of users that have been granted at least one global permission.

The authenticated user must have ADMIN permission or higher to call this resource.

Request

Query parameters

filter

string

start

number

limit

number

Responses

A page of users and their highest global permissions.

application/json

object
GET/api/latest/admin/permissions/users
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/permissions/users' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "values": [ { "permission": "ADMIN", "group": { "name": "group_a" } } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
PUT

Put api latest admin permissions users

Promote or demote the global permission level of a user. Available global permissions are:

  • LICENSED_USER
  • PROJECT_CREATE
  • ADMIN
  • SYS_ADMIN

See the Bitbucket Server documentation for a detailed explanation of what each permission entails.

The authenticated user must have:

  • ADMIN permission or higher; and
  • the permission they are attempting to grant; and
  • greater or equal permissions than the current permission level of the user (a user may not demote the permission level of a user with higher permissions than them)

to call this resource. In addition, a user may not demote their own permission level.

Request

Query parameters

name

array<string>

Required
permission

string

Required

Responses

The requested permission was granted.

PUT/api/latest/admin/permissions/users
1 2 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/admin/permissions/users?name={name}&permission={permission}'
DEL

Delete api latest admin permissions users

Revoke all global permissions for a user.

The authenticated user must have:

  • ADMIN permission or higher; and
  • greater or equal permissions than the current permission level of the user (a user may not demote the permission level of a user with higher permissions than them)

to call this resource. In addition, a user may not demote their own permission level.

Request

Query parameters

name

string

Required

Responses

All global permissions were revoked from the user.

DEL/api/latest/admin/permissions/users
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/admin/permissions/users?name={name}'
GET

Get api latest admin permissions users none

Retrieve a page of users that have no granted global permissions.

The authenticated user must have ADMIN permission or higher to call this resource.

Request

Query parameters

filter

string

start

number

limit

number

Responses

A page of users that have not been granted any global permissions.

application/json

object
GET/api/latest/admin/permissions/users/none
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/permissions/users/none' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 { "values": [ { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest admin pull-requests {scmId}

Retrieve the merge strategies available for this instance. The user must be authenticated to call this resource.

Request

Path parameters

scmId

string

Required

Responses

The merge configuration of this instance.

application/json

RestPullRequestMergeConfig
GET/api/latest/admin/pull-requests/{scmId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/pull-requests/{scmId}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "strategies": [ { "flag": "--no-ff", "name": "Merge commit", "id": "no-ff", "enabled": true, "description": "Always create a merge commit" } ], "commitSummaries": 2154, "defaultStrategy": { "flag": "--no-ff", "name": "Merge commit", "id": "no-ff", "enabled": true, "description": "Always create a merge commit" }, "type": "repository" }
POST

Post api latest admin pull-requests {scmId}

Update the pull request merge strategies for the context repository.

The authenticated user must have ADMIN permission to call this resource.

Only the strategies provided will be enabled, only one may be set to default

An explicitly set pull request merge strategy configuration can be deleted by POSTing a document with an empty "mergeConfig" attribute. i.e:```{ "mergeConfig": { } }

1 2 Upon completion of this request, the effective configuration will be the default configuration.

Request

Path parameters

scmId

string

Required

Request bodyapplication/json

the settings

mergeConfig

object

Responses

The repository pull request merge strategies for the context repository.

application/json

RestPullRequestMergeConfig
POST/api/latest/admin/pull-requests/{scmId}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/admin/pull-requests/{scmId}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "mergeConfig": { "strategies": [ { "id": "no-ff", "links": {} } ], "commitSummaries": 2154, "defaultStrategy": { "id": "no-ff", "links": {} } } }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "strategies": [ { "flag": "--no-ff", "name": "Merge commit", "id": "no-ff", "enabled": true, "description": "Always create a merge commit" } ], "commitSummaries": 2154, "defaultStrategy": { "flag": "--no-ff", "name": "Merge commit", "id": "no-ff", "enabled": true, "description": "Always create a merge commit" }, "type": "repository" }
GET

Get api latest admin rate-limit history

Retrieves the recent rate limit history for the instance.

The authenticated user must have the ADMIN permission to call this resource.

Request

Query parameters

order

string

start

number

limit

number

Responses

A response containing a page of aggregated counters for users who have been recently rate limited.

application/json

object
GET/api/latest/admin/rate-limit/history
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/rate-limit/history' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 { "values": [ { "lastRejectTime": 1630041546433, "rejectCount": 5, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest admin rate-limit settings

Retrieves the rate limit settings for the instance. The user must be authenticated to call this resource.

Request

This request has no parameters.

Responses

A response containing the rate limit plugin settings for the instance.

application/json

RestRateLimitSettings
GET/api/latest/admin/rate-limit/settings
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 { "defaultSettings": { "capacity": 60, "fillRate": 5 }, "enabled": true }
PUT

Put api latest admin rate-limit settings

Sets the rate limit settings for the instance.

The authenticated user must have ADMIN permission to call this resource.

Request

Request bodyapplication/json

Sets the rate limit settings for the instance.

The authenticated user must have ADMIN permission to call this resource.

defaultSettings

object

enabled

boolean

Responses

A response containing the updated rate limit plugin settings for the instance.

application/json

RestRateLimitSettings
PUT/api/latest/admin/rate-limit/settings
1 2 3 4 5 6 7 8 9 10 11 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "defaultSettings": { "capacity": 60, "fillRate": 5 }, "enabled": true }'
200Response
1 2 3 4 5 6 7 { "defaultSettings": { "capacity": 60, "fillRate": 5 }, "enabled": true }
GET

Get api latest admin rate-limit settings users

Retrieves the user-specific rate limit settings for the given user.

The authenticated user must have ADMIN permission to call this resource.

Request

Query parameters

filter

string

start

number

limit

number

Responses

A response containing all the user-specific rate limit settings filtered by the optional filter.

application/json

object
GET/api/latest/admin/rate-limit/settings/users
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings/users' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "whitelisted": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "settings": { "capacity": 60, "fillRate": 5 } } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest admin rate-limit settings users

Sets the given rate limit settings for the given users.

The authenticated user must have ADMIN permission to call this resource.

Request

Request bodyapplication/json

settings

object

usernames

array<string>

whitelisted

boolean

Responses

A response containing the updated user settings.

application/json

RestUserRateLimitSettings
POST/api/latest/admin/rate-limit/settings/users
1 2 3 4 5 6 7 8 9 10 11 12 13 14 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings/users' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "settings": { "capacity": 60, "fillRate": 5 }, "usernames": [ "<string>" ], "whitelisted": true }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 { "whitelisted": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "settings": { "capacity": 60, "fillRate": 5 } }
GET

Get api latest admin rate-limit settings users {userSlug}

Retrieves the user-specific rate limit settings for the given user.

To call this resource, the user must be authenticated and either have ADMIN permission or be the same user as the one whose settings are requested. A user with ADMIN permission cannot get the settings of a user with SYS_ADMIN permission.

Request

Path parameters

userSlug

string

Required

Responses

A response containing the user-specific rate limit settings for the given user.

application/json

RestUserRateLimitSettings
GET/api/latest/admin/rate-limit/settings/users/{userSlug}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings/users/{userSlug}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 { "whitelisted": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "settings": { "capacity": 60, "fillRate": 5 } }
PUT

Put api latest admin rate-limit settings users {userSlug}

Sets the given rate limit settings for the given user.

The authenticated user must have ADMIN permission to call this resource.

Request

Path parameters

userSlug

string

Required

Request bodyapplication/json

settings

object

whitelisted

boolean

Responses

A response containing the updated user settings

application/json

RestUserRateLimitSettings
PUT/api/latest/admin/rate-limit/settings/users/{userSlug}
1 2 3 4 5 6 7 8 9 10 11 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings/users/{userSlug}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "settings": { "capacity": 60, "fillRate": 5 }, "whitelisted": true }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 { "whitelisted": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "settings": { "capacity": 60, "fillRate": 5 } }
DEL

Delete api latest admin rate-limit settings users {userSlug}

Deletes the user-specific rate limit settings for the given user.

The authenticated user must have ADMIN permission to call this resource.

Request

Path parameters

userSlug

string

Required

Responses

An empty response indicating that the user settings have been deleted.

DEL/api/latest/admin/rate-limit/settings/users/{userSlug}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings/users/{userSlug}'
GET

Get api latest admin users

Retrieve a page of users.

The authenticated user must have the LICENSED_USER permission to call this resource.

Request

Query parameters

filter

string

start

number

limit

number

Responses

A page of users.

application/json

object
GET/api/latest/admin/users
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/users' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 { "values": [ { "directoryName": "Bitbucket Internal Directory", "lastAuthenticationTimestamp": 1368145580548, "mutableDetails": true, "mutableGroups": true, "deletable": true, "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
PUT

Put api latest admin users

Update a user's details.

The authenticated user must have the ADMIN permission to call this resource.

Request

Request bodyapplication/json

displayName

string

email

string

name

string

Responses

The updated user.

application/json

RestDetailedUser
PUT/api/latest/admin/users
1 2 3 4 5 6 7 8 9 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/admin/users' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "displayName": "Jane Citizen", "email": "jane@example.com", "name": "jcitizen" }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "directoryName": "Bitbucket Internal Directory", "lastAuthenticationTimestamp": 1368145580548, "mutableDetails": true, "mutableGroups": true, "deletable": true, "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }
POST

Post api latest admin users

Creates a new user from the assembled query parameters.

The default group can be used to control initial permissions for new users, such as granting users the ability to login or providing read access to certain projects or repositories. If the user is not added to the default group, they may not be able to login after their account is created until explicit permissions are configured.

The authenticated user must have the ADMIN permission to call this resource.

Request

Query parameters

emailAddress

string

Required
password

string

addToDefaultGroup

boolean

displayName

string

Required
name

string

Required
notify

boolean

Responses

The user was successfully created.

POST/api/latest/admin/users
1 2 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/admin/users?emailAddress={emailAddress}&displayName={displayName}&name={name}'
DEL

Delete api latest admin users

Deletes the specified user, removing them from the system. This also removes any permissions that may have been granted to the user.

A user may not delete themselves, and a user with ADMIN permissions may not delete a user with SYS_ADMINpermissions.

The authenticated user must have the ADMIN permission to call this resource.

Request

Query parameters

name

string

Required

Responses

The deleted user.

application/json

RestDetailedUser
DEL/api/latest/admin/users
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/admin/users?name={name}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "directoryName": "Bitbucket Internal Directory", "lastAuthenticationTimestamp": 1368145580548, "mutableDetails": true, "mutableGroups": true, "deletable": true, "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }
POST

Post api latest admin users add-groupDeprecated

Deprecated since 2.10. Use /rest/users/add-groups instead.

Add a user to a group. This is very similar to groups/add-user, but with the context and itemName attributes of the supplied request entity reversed. On the face of it this may appear redundant, but it facilitates a specific UI component in Stash.

In the request entity, the context attribute is the user and the itemName is the group.

The authenticated user must have the ADMIN permission to call this resource.

Request

Request bodyapplication/json

context

string

itemName

string

Responses

The user was added to the group

application/json

any

POST/api/latest/admin/users/add-group
1 2 3 4 5 6 7 8 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/admin/users/add-group' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "context": "group_a", "itemName": "user_a" }'
POST

Post api latest admin users add-groups

Add a user to one or more groups.

The authenticated user must have the ADMIN permission to call this resource.

Request

Request bodyapplication/json

groups

array<string>

Required
user

string

Responses

The user was added to all the groups

application/json

any

POST/api/latest/admin/users/add-groups
1 2 3 4 5 6 7 8 9 10 11 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/admin/users/add-groups' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "groups": [ "group_a", "group_b" ], "user": "user" }'
DEL

Delete api latest admin users captcha

Clears any CAPTCHA challenge that may constrain the user with the supplied username when they authenticate. Additionally any counter or metric that contributed towards the user being issued the CAPTCHA challenge (for instance too many consecutive failed logins) will also be reset.

The authenticated user must have the ADMIN permission to call this resource, and may not clear the CAPTCHA of a user with greater permissions than themselves.

Request

Query parameters

name

string

Required

Responses

The CAPTCHA was successfully cleared.

DEL/api/latest/admin/users/captcha
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/admin/users/captcha?name={name}'
PUT

Put api latest admin users credentials

Update a user's password.

The authenticated user must have the ADMIN permission to call this resource, and may not update the password of a user with greater permissions than themselves.

Request

Request bodyapplication/json

name

string

password

string

passwordConfirm

string

Responses

The user's password was successfully updated.

PUT/api/latest/admin/users/credentials
1 2 3 4 5 6 7 8 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/admin/users/credentials' \ --header 'Content-Type: application/json' \ --data '{ "name": "jcitizen", "password": "my-secret-password", "passwordConfirm": "my-secret-password" }'
GET

Get api latest admin users erasure

Validate if a user can be erased.

A username is only valid for erasure if it exists as the username of a deleted user. This endpoint will return an appropriate error response if the supplied username is invalid for erasure.

This endpoint does not perform the actual user erasure, and will not modify the application in any way.

The authenticated user must have the ADMIN permission to call this resource.

Request

Query parameters

name

string

Required

Responses

the user is erasable

GET/api/latest/admin/users/erasure
1 2 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/users/erasure?name={name}'
POST

Post api latest admin users erasure

Erases personally identifying user data for a deleted user.

References in the application to the original username will be either removed or updated to a new non-identifying username. Refer to the support guide for details about what data is and isn't erased.

User erasure can only be performed on a deleted user. If the user has not been deleted first then this endpoint will return a bad request and no erasure will be performed.

Erasing user data is irreversible and may lead to a degraded user experience. This method should not be used as part of a standard user deletion and cleanup process.

Plugins can participate in user erasure by defining a <user-erasure-handler> module. If one or more plugin modules fail, an error summary of the failing modules is returned.

The authenticated user must have the ADMIN permission to call this resource.

Request

Query parameters

name

string

Required

Responses

The identifier of the erased user.

application/json

RestErasedUser
POST/api/latest/admin/users/erasure
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/admin/users/erasure?name={name}' \ --header 'Accept: application/json'
200Response
1 2 3 { "newIdentifier": "user-123ab" }
GET

Get api latest admin users more-members

Retrieves a list of users that are not members of a specified group.

The authenticated user must have the LICENSED_USER permission to call this resource.

Request

Query parameters

filter

string

context

string

Required
start

number

limit

number

Responses

A page of users.

application/json

object
GET/api/latest/admin/users/more-members
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/users/more-members?context={context}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 { "values": [ { "directoryName": "Bitbucket Internal Directory", "lastAuthenticationTimestamp": 1368145580548, "mutableDetails": true, "mutableGroups": true, "deletable": true, "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest admin users more-non-members

Retrieves a list of groups the specified user is not a member of.

The authenticated user must have the LICENSED_USER permission to call this resource.

Request

Query parameters

filter

string

context

string

Required
start

number

limit

number

Responses

A page of groups.

application/json

object
GET/api/latest/admin/users/more-non-members
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/users/more-non-members?context={context}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 { "values": [ { "deletable": true, "name": "group-a" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest admin users remove-group

Remove a user from a group. This is very similar to groups/remove-user, but with the context and itemName attributes of the supplied request entity reversed. On the face of it this may appear redundant, but it facilitates a specific UI component in Stash.

In the request entity, the context attribute is the user and the itemName is the group.

The authenticated user must have the ADMIN permission to call this resource.

Request

Request bodyapplication/json

context

string

itemName

string

Responses

The user was removed from the group.

application/json

any

POST/api/latest/admin/users/remove-group
1 2 3 4 5 6 7 8 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/admin/users/remove-group' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "context": "group_a", "itemName": "user_a" }'
POST

Post api latest admin users rename

Rename a user.

The authenticated user must have the ADMIN permission to call this resource.

Request

Request bodyapplication/json

name

string

newName

string

Responses

The renamed user.

application/json

RestDetailedUser
POST/api/latest/admin/users/rename
1 2 3 4 5 6 7 8 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/admin/users/rename' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "name": "jcitizen", "newName": "jcitizen-new" }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "directoryName": "Bitbucket Internal Directory", "lastAuthenticationTimestamp": 1368145580548, "mutableDetails": true, "mutableGroups": true, "deletable": true, "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }
GET

Get api latest application-properties

Retrieve version information and other application properties. No authentication is required to call this resource.

Request

This request has no parameters.

Responses

The application properties

application/json

RestApplicationProperties
GET/api/latest/application-properties
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/application-properties' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 { "buildDate": "1358897885952000", "displayName": "Example.com Bitbucket", "version": "2.1.0", "buildNumber": "20220123103656677" }
GET

Get api latest build capabilities

Returns the build capabilities of this instance

Request

This request has no parameters.

Responses

capabilities

application/json

RestBuildCapabilities
GET/api/latest/build/capabilities
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/build/capabilities' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 { "buildStatus": [ "richBuildStatus" ] }
GET

Get api latest dashboard pull-request-suggestions

Retrieves a page of suggestions for pull requests that the currently authenticated user may wish to raise. Such suggestions are based on ref changes occurring and so contain the ref change that prompted the suggestion plus the time the change event occurred. Changes will be returned in descending order based on the time the change that prompted the suggestion occurred. Note that although the response is a page object, the interface does not support paging, however a limit can be applied to the size of the returned page.

Request

Query parameters

changesSince

string

limit

string

Responses

A page of pull requests that match the search criteria.

application/json

object
GET/api/latest/dashboard/pull-request-suggestions
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/dashboard/pull-request-suggestions' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "fromRef": { "displayId": "master", "id": "refs/heads/master", "type": "BRANCH" }, "toRef": { "displayId": "master", "id": "refs/heads/master", "type": "BRANCH" }, "changeTme": 1359075920, "refChange": { "fromHash": "6053a1eaa1c009dd11092d09a72f3c41af1b59ad", "toHash": "d6edcbf924697ab811a867421dab60d954ccad99", "refId": "refs/heads/master", "type": "ADD", "ref": { "displayId": "master", "id": "refs/heads/master", "type": "BRANCH" } }, "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest dashboard pull-requests

Retrieve a page of pull requests where the current authenticated user is involved as either a reviewer, author or a participant. The request may be filtered by pull request state, role or participant status.

Request

Query parameters

closedSince

string

role

string

participantStatus

string

state

string

order

string

start

number

limit

number

Responses

A page of pull requests that match the search criteria.

application/json

object
GET/api/latest/dashboard/pull-requests
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/dashboard/pull-requests' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest deployment capabilities

Returns the Deployment capabilities of this instance

Request

This request has no parameters.

Responses

capabilities

application/json

any

GET/api/latest/deployment/capabilities
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/deployment/capabilities' \ --header 'Accept: application/json'
GET

Get api latest groups

Retrieve a page of group names.

The authenticated user must have LICENSED_USER permission or higher to call this resource.

Request

Query parameters

filter

string

start

number

limit

number

Responses

A page of group names.

application/json

object
GET/api/latest/groups
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/groups' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 { "values": [ "<string>" ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest hook-scripts

Create a new hook script.

This endpoint requires SYS_ADMIN permission.

Request

Request bodymultipart/form-data

The multipart form data containing the hook script

content

string

description

string

name

string

type

string

Responses

The newly created hook script.

application/json

RestHookScript
POST/api/latest/hook-scripts
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/hook-scripts' \ --header 'Accept: application/json'
201Response
1 2 3 4 5 6 7 8 9 10 { "createdDate": "<string>", "updatedDate": "<string>", "version": 2154, "name": "<string>", "id": 2154, "type": "POST", "description": "<string>", "pluginKey": "<string>" }
GET

Get api latest hook-scripts {scriptId}

Retrieves a hook script by ID.

Request

Path parameters

scriptId

string

Required

Responses

The hook script.

application/json

RestHookScript
GET/api/latest/hook-scripts/{scriptId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/hook-scripts/{scriptId}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 { "createdDate": "<string>", "updatedDate": "<string>", "version": 2154, "name": "<string>", "id": 2154, "type": "POST", "description": "<string>", "pluginKey": "<string>" }
PUT

Put api latest hook-scripts {scriptId}

Updates a hook script.

This endpoint requires SYS_ADMIN permission.

Request

Path parameters

scriptId

string

Required

Request body*/*

The multipart form data containing the hook script

content

string

description

string

name

string

Responses

The updated hook script.

application/json

RestHookScript
PUT/api/latest/hook-scripts/{scriptId}
1 2 3 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/hook-scripts/{scriptId}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 { "createdDate": "<string>", "updatedDate": "<string>", "version": 2154, "name": "<string>", "id": 2154, "type": "POST", "description": "<string>", "pluginKey": "<string>" }
DEL

Delete api latest hook-scripts {scriptId}

Deletes a registered hook script.

This endpoint requires SYS_ADMIN permission.

Request

Path parameters

scriptId

string

Required

Responses

The hook script was deleted.

DEL/api/latest/hook-scripts/{scriptId}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/hook-scripts/{scriptId}'
GET

Get api latest hook-scripts {scriptId} content

Retrieves the hook script content.

This endpoint requires SYS_ADMIN permission.

Request

Path parameters

scriptId

string

Required

Responses

The hook script content.

application/json

any

GET/api/latest/hook-scripts/{scriptId}/content
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/hook-scripts/{scriptId}/content' \ --header 'Accept: application/json'
GET

Get api latest hooks {hookKey} avatar

Retrieve the avatar for the project matching the supplied moduleKey.

Request

Path parameters

hookKey

string

Required

Query parameters

version

string

Responses

The avatar of the project matching the supplied moduleKey.

application/json

any

GET/api/latest/hooks/{hookKey}/avatar
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/hooks/{hookKey}/avatar' \ --header 'Accept: application/json'
GET

Get api latest inbox pull-requests

Request

Query parameters

role

string

limit

integer

start

integer

Responses

default response

application/json;charset=UTF-8

any

GET/api/latest/inbox/pull-requests
1 2 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/inbox/pull-requests'
GET

Get api latest inbox pull-requests count

Request

This request has no parameters.

Responses

default response

application/json;charset=UTF-8

any

GET/api/latest/inbox/pull-requests/count
1 2 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/inbox/pull-requests/count'
GET

Get api latest labels

Returns a paged response of all the labels in the system. The user needs to be authenticated to use this resource.

Request

Query parameters

prefix

string

start

number

limit

number

Responses

Page of returned labels.

application/json

object
GET/api/latest/labels
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/labels' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 { "values": [ { "name": "labelName" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest labels {labelName}

Returns a label. The user needs to be authenticated to use this resource.

Request

Path parameters

labelName

string

Required

Responses

The label.

application/json

RestLabel
GET/api/latest/labels/{labelName}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/labels/{labelName}' \ --header 'Accept: application/json'
200Response
1 2 3 { "name": "labelName" }
GET

Get api latest labels {labelName} labeled

Returns a page of labelables for a given label. Only labelables that the authenticated user has view access to will be returned.

Request

Path parameters

labelName

string

Required

Query parameters

type

string

start

number

limit

number

Responses

The page of labelables.

application/json

object
GET/api/latest/labels/{labelName}/labeled
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/labels/{labelName}/labeled' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "labelableType": "REPOSITORY", "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest logs logger {loggerName}

Retrieve the current log level for a given logger.

The authenticated user must have ADMIN permission or higher to call this resource.

Request

Path parameters

loggerName

string

Required

Responses

The log level of the logger.

application/json

RestLogLevel
GET/api/latest/logs/logger/{loggerName}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/logs/logger/{loggerName}' \ --header 'Accept: application/json'
200Response
1 2 3 { "logLevel": "DEBUG" }
PUT

Put api latest logs logger {loggerName} {levelName}

Set the current log level for a given logger.

The authenticated user must have ADMIN permission or higher to call this resource.

Request

Path parameters

levelName

string

Required
loggerName

string

Required

Responses

The log level was successfully changed.

PUT/api/latest/logs/logger/{loggerName}/{levelName}
1 2 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/logs/logger/{loggerName}/{levelName}'
GET

Get api latest logs rootLogger

Retrieve the current log level for the root logger.

The authenticated user must have ADMIN permission or higher to call this resource.

Request

This request has no parameters.

Responses

The log level of the logger.

application/json

RestLogLevel
GET/api/latest/logs/rootLogger
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/logs/rootLogger' \ --header 'Accept: application/json'
200Response
1 2 3 { "logLevel": "DEBUG" }
PUT

Put api latest logs rootLogger {levelName}

Set the current log level for the root logger.

The authenticated user must have ADMIN permission or higher to call this resource.

Request

Path parameters

levelName

string

Required

Responses

The log level was successfully changed.

PUT/api/latest/logs/rootLogger/{levelName}
1 2 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/logs/rootLogger/{levelName}'
POST

Post api latest markup preview

Preview generated HTML for the given markdown content. Only authenticated users may call this resource.

Request

Query parameters

htmlEscape

string

urlMode

string

includeHeadingId

string

hardwrap

string

Request body*/*

string

Responses

The rendered markdown.

application/json

RestMarkup
POST/api/latest/markup/preview
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/markup/preview' \ --header 'Accept: application/json'
200Response
1 2 3 { "html": "<h1>Hello World!</h1>" }
POST

Post api latest migration exports

Starts a background job that exports the selected repositories.

Only 2 concurrent exports are supported per cluster node. If a request ends up on a node that is already running that many export jobs, the request will be rejected and an error returned.

The response includes a description of the job that has been started, and its ID can be used to query these details again, including the current progress, warnings and errors that occurred while processing the job, and to interrupt and cancel the execution of this job.

The request to start an export is similar to the one for previewing an export. Additionally, it accepts an optional parameter, exportLocation, which can be used to specify a relative path within data/migration/export in the shared home directory. No locations outside of that directory will be accepted for exports.

There are essentially three ways to select repositories for export. Regardless of which you use, a few general rules apply:

  • You can supply a list of selectors. The selection will be additive.
  • Repositories that are selected more than once due to overlapping selectors will be de-duplicated and effectively exported only once.
  • For every selected repository, its full fork hierarchy will be considered selected, even if parts of that hierarchy would otherwise not be matched by the provided selectors. For example, when you explicitly select a single repository only, but that repository is a fork, then its origin will be exported (and eventually imported), too.

Now, a single repository can be selected like this:

1 2 3 4 5 6 7 8 { "projectKey": "PRJ", "slug": "my-repo" }

Second, all repositories in a specific project can be selected like this:

1 2 3 4 5 6 7 8 { "projectKey": "PRJ", "slug": *" }

And third, all projects and repositories in the system would be selected like this:

1 2 3 4 5 6 7 8 { "projectKey": "*", "slug": *" }

The authenticated user must have ADMIN permission or higher to call this resource.

Request

Request bodyapplication/json

The request

exportLocation

string

repositoriesRequest

object

Required

Responses

Details about the export job.

application/json

RestJob
POST/api/latest/migration/exports
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/migration/exports' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "exportLocation": "example/sub/directory", "repositoriesRequest": { "includes": [ { "projectKey": "PRJ", "slug": "my-repo" } ] } }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 { "endDate": 1497657603000, "startDate": 1497657601000, "nodeId": "1bec7499-077a-4b58-b27c-996a9c2187a4", "initiator": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1497657603000, "progress": { "percentage": 42, "message": "Working on it..." }, "id": 1, "state": "INITIALISING", "type": "com.atlassian.bitbucket.migration.export" }
POST

Post api latest migration exports preview

Enumerates the projects and repositories that would be exported for a given export request.

All affected repositories will be enumerated explicitly, and while projects are listed as individual items in responses from this endpoint, their presence does not imply that all their repositories are included.

While this endpoint can be used to verify that all selectors in the request apply as intended, it should be noted that a subsequent, actual export might contain a different set of repositories, as they might have been added or deleted in the meantime.

Note that the overall response from this endpoint can become very large when a lot of repositories end up in the selection. This is why the server is streaming the response while it is being generated (as opposed to creating it in memory and then sending it all at once) and it can be consumed in a streaming way, too.

Also, due to the potential size of the response, projects and repositories are listed with fewer details than in other REST responses.

For a more detailed description of selectors, see the endpoint documentation for starting an export.

The authenticated user must have ADMIN permission or higher to call this resource.

Request

Request bodyapplication/json

the export request

exportLocation

string

repositoriesRequest

object

Required

Responses

The effectively selected projects and repositories.

application/json

RestScopesExample
POST/api/latest/migration/exports/preview
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/migration/exports/preview' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "exportLocation": "example/sub/directory", "repositoriesRequest": { "includes": [ { "projectKey": "PRJ", "slug": "my-repo" } ] } }'
200Response
1 2 3 4 5 { "scopes": [ {} ] }
GET

Get api latest migration exports {jobId}

Gets the details, including the current status and progress, of the export job identified by the given ID.

The authenticated user must have ADMIN permission or higher to call this resource.

Request

Path parameters

jobId

string

Required

Responses

The job, including status and progress information.

application/json

RestJob
GET/api/latest/migration/exports/{jobId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/migration/exports/{jobId}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 { "endDate": 1497657603000, "startDate": 1497657601000, "nodeId": "1bec7499-077a-4b58-b27c-996a9c2187a4", "initiator": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1497657603000, "progress": { "percentage": 42, "message": "Working on it..." }, "id": 1, "state": "INITIALISING", "type": "com.atlassian.bitbucket.migration.export" }
POST

Post api latest migration exports {jobId} cancel

Requests the cancellation of an export job.

The request to cancel a job will be processed successfully if the job is actually still running. If it has already finished (successfully or with errors) or if it has already been canceled before, then an error will be returned.

There might be a small delay between accepting the request and actually cancelling the job. In most cases, the delay will be close to instantaneously. In the unlikely case of communication issues across a cluster, it can however take a few seconds to cancel a job.

A client should always actively query the job status to confirm that a job has been successfully canceled.

The authenticated user must have ADMIN permission or higher to call this resource.

Request

Path parameters

jobId

string

Required

Responses

The job has successfully been marked for cancellation

POST/api/latest/migration/exports/{jobId}/cancel
1 2 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/migration/exports/{jobId}/cancel'
GET

Get api latest migration exports {jobId} messages

Gets the messages generated by the job.

Without any filter, all messages will be returned, but the response can optionally be filtered for the following severities. The severity parameter can be repeated to include multiple severities in one response.

  • INFO
  • WARN
  • ERROR

The authenticated user must have ADMIN permission or higher to call this resource.

Request

Path parameters

jobId

string

Required

Query parameters

severity

string

subject

string

start

number

limit

number

Responses

The messages generated by this job.

application/json

object
GET/api/latest/migration/exports/{jobId}/messages
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/migration/exports/{jobId}/messages' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 { "values": [ { "createdDate": "<string>", "severity": "INFO", "subject": "job", "id": "617", "text": "Something of interest happened" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest migration imports

Starts a background job that imports the specified archive.

Only 1 import at a time is supported per cluster. If another request is made while an import is already running, the request will be rejected and an error returned.

The path in the request must point to a valid archive file. The file must be located within the data/migration/import directory in the shared home directory.

The authenticated user must have ADMIN permission or higher to call this resource.

Request

Request bodyapplication/json

The request

archivePath

string

Responses

Details about the export job.

application/json

RestJob
POST/api/latest/migration/imports
1 2 3 4 5 6 7 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/migration/imports' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "archivePath": "Bitbucket_export_1.tar" }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 { "endDate": 1497657603000, "startDate": 1497657601000, "nodeId": "1bec7499-077a-4b58-b27c-996a9c2187a4", "initiator": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1497657603000, "progress": { "percentage": 42, "message": "Working on it..." }, "id": 1, "state": "INITIALISING", "type": "com.atlassian.bitbucket.migration.export" }
GET

Get api latest migration imports {jobId}

Gets the details, including the current status and progress, of the import job identified by the given ID.

The authenticated user must have ADMIN permission or higher to call this resource.

Request

Path parameters

jobId

string

Required

Responses

The job, including status and progress information.

application/json

RestJob
GET/api/latest/migration/imports/{jobId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/migration/imports/{jobId}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 { "endDate": 1497657603000, "startDate": 1497657601000, "nodeId": "1bec7499-077a-4b58-b27c-996a9c2187a4", "initiator": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1497657603000, "progress": { "percentage": 42, "message": "Working on it..." }, "id": 1, "state": "INITIALISING", "type": "com.atlassian.bitbucket.migration.export" }
POST

Post api latest migration imports {jobId} cancel

Requests the cancellation of an import job.

The request to cancel a job will be processed successfully if the job is actually still running. If it has already finished (successfully or with errors) or if it has already been canceled before, then an error will be returned.

Note that import jobs are not canceled as instantaneously as export jobs. Rather, once the request has been accepted, there are a number of checkpoints at which the job will actually apply it and stop. This is to keep the system in a reasonably consistent state:

  • After the current fork hierarchy has been imported and verified.
  • Before the next repository is imported.
  • Before the next pull request is imported.

A client should always actively query the job status to confirm that a job has been successfully canceled.

The authenticated user must have ADMIN permission or higher to call this resource.

Request

Path parameters

jobId

string

Required

Responses

The job has successfully been marked for cancellation.

POST/api/latest/migration/imports/{jobId}/cancel
1 2 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/migration/imports/{jobId}/cancel'
GET

Get api latest migration imports {jobId} messages

Gets the messages generated by the job.

Without any filter, all messages will be returned, but the response can optionally be filtered for the following severities. The severity parameter can be repeated to include multiple severities in one response.

  • INFO
  • WARN
  • ERROR

The authenticated user must have ADMIN permission or higher to call this resource.

Request

Path parameters

jobId

string

Required

Query parameters

severity

string

subject

string

start

number

limit

number

Responses

The messages generated by this job.

application/json

object
GET/api/latest/migration/imports/{jobId}/messages
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/migration/imports/{jobId}/messages' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 { "values": [ { "createdDate": "<string>", "severity": "INFO", "subject": "job", "id": "617", "text": "Something of interest happened" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest migration mesh

Starts a background job that migrates selected projects/repositories to Mesh.

Only 1 job is supported per cluster.

The response includes a description of the job that has been started, and its ID can be used to query these details again, including the current progress, and to interrupt and cancel the execution of this job.

The request to start a migration is similar to the one for previewing a migration.

There are essentially three ways to select repositories for migration. Regardless of which you use, a few general rules apply:

1 - You can supply a list of repository IDs and project IDs. The selection will be additive. All repositories in the system are migrated if both lists are empty. - Repositories that are selected more than once due to overlapping IDs will be de-duplicated and effectively migrated only once. - For every selected repository, its full fork hierarchy will be considered selected, even if parts of that hierarchy would otherwise not be matched by the provided IDs. For example, when you explicitly select a single repository only, but that repository is a fork, then its origin will be migrated too.

Now, a single repository can be selected like this:

1 2 3 4 { "repositoryIds": [1] }

Multiple repositories can be selected like this:

1 2 3 4 { "repositoryIds": [1, 2] }

Second, all repositories in a specific project can be selected like this:

1 2 3 4 { "projectIds": [1] }

And third, all projects and repositories in the system would be selected like this:

1 2 3 4 5 { "projectIds": [], "repositoryIds": [] }

The authenticated user must have SYS_ADMIN permission to call this resource.

Request

Request bodyapplication/json

all

boolean

maxBytesPerSecond

object

projectIds

array<integer>

repositoryIds

array<integer>

Responses

The started job

application/json

RestJob
POST/api/latest/migration/mesh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/migration/mesh' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "all": true, "maxBytesPerSecond": { "asLong": 2154, "present": true }, "projectIds": [ 2154 ], "repositoryIds": [ 2154 ] }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 { "endDate": 1497657603000, "startDate": 1497657601000, "nodeId": "1bec7499-077a-4b58-b27c-996a9c2187a4", "initiator": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1497657603000, "progress": { "percentage": 42, "message": "Working on it..." }, "id": 1, "state": "INITIALISING", "type": "com.atlassian.bitbucket.migration.export" }
POST

Post api latest migration mesh preview

Enumerates the projects and repositories that would be migrated for a given request.

All affected repositories will be enumerated explicitly, and while projects are listed as individual items in responses from this endpoint, their presence does not imply that all their repositories are included.

While this endpoint can be used to verify that all selectors in the request apply as intended, it should be noted that a subsequent, actual export might contain a different set of repositories, as they might have been added or deleted in the meantime.

Note that the overall response from this endpoint can become very large when a lot of repositories end up in the selection. This is why the server is streaming the response while it is being generated (as opposed to creating it in memory and then sending it all at once) and it can be consumed in a streaming way, too.

Also, due to the potential size of the response, projects and repositories are listed with fewer details than in other REST responses.

The authenticated user must have SYS_ADMIN permission to call this resource.

Request

Request bodyapplication/json

The export request

all

boolean

maxBytesPerSecond

object

projectIds

array<integer>

repositoryIds

array<integer>

Responses

Enumeration of projects and repositories that would be migrated for a given request.

application/json

ExamplePreviewMigration
POST/api/latest/migration/mesh/preview
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/migration/mesh/preview' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "all": true, "maxBytesPerSecond": { "asLong": 2154, "present": true }, "projectIds": [ 2154 ], "repositoryIds": [ 2154 ] }'
200Response
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 { "repositories": [ { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } ] }
GET

Get api latest migration mesh repos

Searches for repositories in the system matching the specified criteria and enriches their MeshMigrationQueueState migration state if a migration is currently in progress.

The currently active migration can optionally be specified by passing a migrationId, if known. If this isn't passed, an attempt is made to locate the active migration and its ID is used.

If a migration is currently active, only repositories that are a part of the migration are filtered and returned. Otherwise, all repositories in the systems are filtered and returned.

Filtering by state is ignored when no migration is currently in progress. In such a case, results are not enriched with their MeshMigrationQueueState migration state.

The authenticated user must have SYS_ADMIN permission to call this resource.

Request

Query parameters

migrationId

string

projectKey

string

name

string

state

string

remote

string

start

number

limit

number

Responses

A page of repositories matching the specified criteria.

application/json

object
GET/api/latest/migration/mesh/repos
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/migration/mesh/repos' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "migrationState": "QUEUED", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest migration mesh summaries

Retrieve a page of Mesh migration job summaries. Jobs are ordered by when they were started, newest first.

The authenticated user must have SYS_ADMIN permission to call this resource.

Request

Query parameters

start

number

limit

number

Responses

The summary of the migration job.

application/json

object
GET/api/latest/migration/mesh/summaries
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/migration/mesh/summaries' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 { "values": [ { "jobId": 2154, "endTime": 1331038800000, "maxBandwidth": 2154, "progress": 53, "queue": {}, "state": "RUNNING", "startTime": 1331038800000 } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest migration mesh summary

Gets the summary, including the queue status and progress, of the currently active Mesh migration job.

The authenticated user must have SYS_ADMIN permission to call this resource.

Request

This request has no parameters.

Responses

The summary of the currently active migration job.

application/json

RestMeshMigrationSummary
GET/api/latest/migration/mesh/summary
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/migration/mesh/summary' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 { "jobId": 2154, "endTime": 1331038800000, "maxBandwidth": 2154, "progress": 53, "queue": {}, "state": "RUNNING", "startTime": 1331038800000 }
GET

Get api latest migration mesh {jobId}

Gets the details, including the current status and progress, of the job identified by the given ID.

The authenticated user must have SYS_ADMIN permission to call this resource.

Request

Path parameters

jobId

string

Required

Responses

The details of the migration job.

application/json

any

GET/api/latest/migration/mesh/{jobId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/migration/mesh/{jobId}' \ --header 'Accept: application/json'
POST

Post api latest migration mesh {jobId} cancel

Requests the cancellation of a migration job.

The request to cancel a job will be processed successfully if the job is actually still running. If it has already finished (successfully or with errors) or if it has already been canceled before, then an error will be returned.

There might be a small delay between accepting the request and actually cancelling the job. In most cases, the delay will be close to instantaneously. In the unlikely case of communication issues across a cluster, it can however take a few seconds to cancel a job.

A client should always actively query the job status to confirm that a job has been successfully canceled.

The authenticated user must have SYS_ADMIN permission to call this resource.

Request

Path parameters

jobId

string

Required

Responses

The migration job was successfully marked for cancellation.

POST/api/latest/migration/mesh/{jobId}/cancel
1 2 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/migration/mesh/{jobId}/cancel'
GET

Get api latest migration mesh {jobId} messages

Gets the messages generated by the job.

Without any filter, all messages will be returned, but the response can optionally be filtered for the following severities. The severity parameter can be repeated to include multiple severities in one response.

1 2 3 - INFO - WARN - ERROR

The authenticated user must have SYS_ADMIN permission to call this resource.

Request

Path parameters

jobId

string

Required

Query parameters

severity

string

subject

string

start

number

limit

number

Responses

The details of the migration job.

application/json

object
GET/api/latest/migration/mesh/{jobId}/messages
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/migration/mesh/{jobId}/messages' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 { "values": [ { "createdDate": "<string>", "severity": "INFO", "subject": "job", "id": "617", "text": "Something of interest happened" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest migration mesh {jobId} summary

Gets the summary, including the queue status and progress, of a Mesh migration job.

The authenticated user must have SYS_ADMIN permission to call this resource.

Request

Path parameters

jobId

string

Required

Responses

The summary of the migration job.

application/json

RestMeshMigrationSummary
GET/api/latest/migration/mesh/{jobId}/summary
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/migration/mesh/{jobId}/summary' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 { "jobId": 2154, "endTime": 1331038800000, "maxBandwidth": 2154, "progress": 53, "queue": {}, "state": "RUNNING", "startTime": 1331038800000 }
GET

Get api latest profile recent repos

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.

Request

Query parameters

permission

string

start

number

limit

number

Responses

A page of recently accessed repositories.

application/json

object
GET/api/latest/profile/recent/repos
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/profile/recent/repos' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects

Retrieve a page of projects.

Only projects for which the authenticated user has the PROJECT_VIEW permission will be returned.

Request

Query parameters

name

string

permission

string

start

number

limit

number

Responses

A page of projects.

application/json

object
GET/api/latest/projects
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "values": [ { "avatar": "<string>", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest projects

Create a new project.

To include a custom avatar for the project, the project definition should contain an additional attribute with the key avatar and the value a data URI containing Base64-encoded image data. The URI should be in the following format:

    data:(content type, e.g. image/png);base64,(data) 
If the data is not Base64-encoded, or if a character set is defined in the URI, or the URI is otherwise invalid, project creation will fail.

The authenticated user must have PROJECT_CREATE permission to call this resource.

Request

Request bodyapplication/json

The project.

avatar

string

avatarUrl

string

key

string

links

object

Responses

The newly created project.

application/json

RestProject
POST/api/latest/projects
1 2 3 4 5 6 7 8 9 10 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "avatar": "<string>", "avatarUrl": "<string>", "key": "PRJ", "links": {} }'
201Response
1 2 3 4 5 6 7 8 9 10 11 { "avatar": "<string>", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT" }
GET

Get api latest projects {projectKey}

Retrieve the project matching the supplied projectKey.

The authenticated user must have PROJECT_VIEW permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required

Responses

The project matching the supplied projectKey.

application/json

RestProject
GET/api/latest/projects/{projectKey}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 { "avatar": "<string>", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT" }
PUT

Put api latest projects {projectKey}

Update the project matching the projectKey supplied in the resource path.

To include a custom avatar for the updated project, the project definition should contain an additional attribute with the key avatar and the value a data URI containing Base64-encoded image data. The URI should be in the following format: data:(content type, e.g. image/png);base64,(data)

If the data is not Base64-encoded, or if a character set is defined in the URI, or the URI is otherwise invalid, project creation will fail.

The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required

Request bodyapplication/json

Project parameters to update.

avatar

string

avatarUrl

string

key

string

links

object

Responses

The updated project. The project's key was not updated.

application/json

RestProject
PUT/api/latest/projects/{projectKey}
1 2 3 4 5 6 7 8 9 10 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "avatar": "<string>", "avatarUrl": "<string>", "key": "PRJ", "links": {} }'
200Response
1 2 3 4 5 6 7 8 9 10 11 { "avatar": "<string>", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT" }
DEL

Delete api latest projects {projectKey}

Delete the project matching the supplied projectKey.

The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required

Responses

The project matching the supplied projectKey was deleted.

DEL/api/latest/projects/{projectKey}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}'
GET

Get api latest projects {projectKey} avatar.png

Retrieve the avatar for the project matching the supplied projectKey.

The authenticated user must have PROJECT_VIEW permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required

Query parameters

s

string

Responses

The avatar of the project matching the supplied projectKey.

application/json

any

GET/api/latest/projects/{projectKey}/avatar.png
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/avatar.png' \ --header 'Accept: application/json'
POST

Post api latest projects {projectKey} avatar.png

Update the avatar for the project matching the supplied projectKey.

This resource accepts POST multipart form data, containing a single image in a form-field named 'avatar'.

There are configurable server limits on both the dimensions (1024x1024 pixels by default) and uploaded file size (1MB by default). Several different image formats are supported, but PNG and JPEG are preferred due to the file size limit.

This resource has Cross-Site Request Forgery (XSRF) protection. To allow the request to pass the XSRF check the caller needs to send an X-Atlassian-Token HTTP header with the value no-check.

An example curl request to upload an image name 'avatar.png' would be: curl -X POST -u username:password -H "X-Atlassian-Token: no-check" http://example.com/rest/api/1.0/projects/STASH/avatar.png -F avatar=@avatar.png

The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required

Request bodymultipart/form-data

The mutlipart form data containing the file.

avatar

string

Responses

The avatar was uploaded successfully.

application/json

any

POST/api/latest/projects/{projectKey}/avatar.png
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/avatar.png' \ --header 'Accept: application/json'
GET

Get api latest projects {projectKey} hook-scripts

Return a page of hook scripts configured for the specified project.

This endpoint requires PROJECT_ADMIN permission.

Request

Path parameters

projectKey

string

Required

Query parameters

start

number

limit

number

Responses

A page of hook scripts.

application/json

object
GET/api/latest/projects/{projectKey}/hook-scripts
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/hook-scripts' \ --header 'Accept: application/json'
201Response
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": [ { "script": { "createdDate": "<string>", "updatedDate": "<string>", "version": 2154, "name": "<string>", "id": 2154, "type": "POST", "description": "<string>", "pluginKey": "<string>" }, "scope": { "resourceId": 2, "type": "GLOBAL" }, "triggerIds": [ "<string>" ] } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
PUT

Put api latest projects {projectKey} hook-scripts {scriptId}

Creates/updates the hook script configuration for the provided hook script and project.

This endpoint requires PROJECT_ADMIN permission.

Request

Path parameters

projectKey

string

Required
scriptId

string

Required

Request bodyapplication/json

The hook triggers for which the hook script should be run

triggerIds

array<string>

Responses

The updated hook script.

application/json

RestHookScriptConfig
PUT/api/latest/projects/{projectKey}/hook-scripts/{scriptId}
1 2 3 4 5 6 7 8 9 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/hook-scripts/{scriptId}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "triggerIds": [ "<string>" ] }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 { "script": { "createdDate": "<string>", "updatedDate": "<string>", "version": 2154, "name": "<string>", "id": 2154, "type": "POST", "description": "<string>", "pluginKey": "<string>" }, "scope": { "resourceId": 2, "type": "GLOBAL" }, "triggerIds": [ "<string>" ] }
DEL

Delete api latest projects {projectKey} hook-scripts {scriptId}

Removes the hook script from the set of hook scripts configured to run in all repositories under the project.

This endpoint requires PROJECT_ADMIN permission.

Request

Path parameters

projectKey

string

Required
scriptId

string

Required

Responses

The hook script was successfully deleted.

DEL/api/latest/projects/{projectKey}/hook-scripts/{scriptId}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/hook-scripts/{scriptId}'
DEL

Delete api latest projects {projectKey} permissions

Revoke all permissions for the specified project for the given groups and users.

The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.

In addition, a user may not revoke a group's permission if their own permission would be revoked as a result, nor may they revoke their own permission unless they have a global permission that already implies that permission.

Request

Path parameters

projectKey

string

Required

Query parameters

user

string

group

string

Responses

All project permissions were revoked from the users and groups for the specified project.

DEL/api/latest/projects/{projectKey}/permissions
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions'
GET

Get api latest projects {projectKey} permissions groups

Retrieve a page of groups that have been granted at least one permission for the specified project.

The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.

Request

Path parameters

projectKey

string

Required

Query parameters

filter

string

start

number

limit

number

Responses

A page of groups and their highest permissions for the specified project.

application/json

object
GET/api/latest/projects/{projectKey}/permissions/groups
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/groups' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "values": [ { "permission": "ADMIN", "group": { "name": "group_a" } } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
PUT

Put api latest projects {projectKey} permissions groups

Promote or demote a group's permission level for the specified project.

The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource. In addition, a user may not demote a group's permission level if theirown permission level would be reduced as a result.

Request

Path parameters

projectKey

string

Required

Query parameters

name

string

permission

string

Responses

The requested permission was granted.

PUT/api/latest/projects/{projectKey}/permissions/groups
1 2 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/groups'
DEL

Delete api latest projects {projectKey} permissions groups

Revoke all permissions for the specified project for a group.

The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.

In addition, a user may not revoke a group's permissions if it will reduce their own permission level.

Request

Path parameters

projectKey

string

Required

Query parameters

name

string

Responses

All project permissions were revoked from the group for the specified project.

DEL/api/latest/projects/{projectKey}/permissions/groups
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/groups'
GET

Get api latest projects {projectKey} permissions groups none

Retrieve a page of groups that have no granted permissions for the specified project.

The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher

Request

Path parameters

projectKey

string

Required

Query parameters

filter

string

start

number

limit

number

Responses

A page of groups that have not been granted any permissions for the specifiedproject.

application/json

object
GET/api/latest/projects/{projectKey}/permissions/groups/none
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/groups/none' \ --header 'Accept: application/json'
202Response
1 2 3 4 5 6 7 8 9 10 11 12 13 { "values": [ { "deletable": true, "name": "group-a" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} permissions users

Retrieve a page of users that have been granted at least one permission for the specified project.

The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.

Request

Path parameters

projectKey

string

Required

Query parameters

filter

string

start

number

limit

number

Responses

A page of users and their highest permissions for the specified project.

application/json

object
GET/api/latest/projects/{projectKey}/permissions/users
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/users' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 { "values": [ { "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "permission": "USER_ADMIN" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
PUT

Put api latest projects {projectKey} permissions users

Promote or demote a user's permission level for the specified project.

The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource. In addition, a user may not reduce their own permission level unless they have a global permission that already implies that permission.

Request

Path parameters

projectKey

string

Required

Query parameters

name

string

permission

string

Responses

The requested permission was granted.

PUT/api/latest/projects/{projectKey}/permissions/users
1 2 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/users'
DEL

Delete api latest projects {projectKey} permissions users

Revoke all permissions for the specified project for a user.

The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.

In addition, a user may not revoke their own project permissions if they do not have a higher global permission.

Request

Path parameters

projectKey

string

Required

Query parameters

name

string

Responses

All project permissions were revoked from the user for the specified project.

DEL/api/latest/projects/{projectKey}/permissions/users
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/users'
GET

Get api latest projects {projectKey} permissions users none

Retrieve a page of licensed users that have no granted permissions for the specified project.

The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.

Request

Path parameters

projectKey

string

Required

Query parameters

filter

string

start

number

limit

number

Responses

A page of users that have not been granted any permissions for the specified project

application/json

object
GET/api/latest/projects/{projectKey}/permissions/users/none
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/users/none' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 { "values": [ { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} permissions {permission} all

Check whether the specified permission is the default permission (granted to all users) for a project.

The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.

Request

Path parameters

projectKey

string

Required
permission

string

Required

Responses

A simple entity indicating whether the specified permission is the defaultpermission for this project.

application/json

RestPermitted
GET/api/latest/projects/{projectKey}/permissions/{permission}/all
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/{permission}/all' \ --header 'Accept: application/json'
200Response
1 2 3 { "permitted": true }
POST

Post api latest projects {projectKey} permissions {permission} all

Grant or revoke a project permission to all users, i.e. set the default permission.

The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.

Request

Path parameters

projectKey

string

Required
permission

string

Required

Query parameters

allow

string

Responses

The requested permission was successfully granted or revoked.

POST/api/latest/projects/{projectKey}/permissions/{permission}/all
1 2 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/{permission}/all'
GET

Get api latest projects {projectKey} repos

Retrieve repositories from the project corresponding to the supplied projectKey.

The authenticated user must have PROJECT_READ permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required

Query parameters

start

number

limit

number

Responses

The repositories matching the supplied projectKey.

application/json

object
GET/api/latest/projects/{projectKey}/repos
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos' \ --header 'Accept: application/json'
201Response
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 { "values": [ { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest projects {projectKey} repos

Create a new repository. Requires an existing project in which this repository will be created. The only parameters which will be used are name and scmId.

The authenticated user must have REPO_CREATE permission or higher, for the context project to call this resource.

Request

Path parameters

projectKey

string

Required

Request bodyapplication/json

The repository

scmId

string

slug

string

name

string

project

string

links

object

Responses

The newly created repository.

application/json

RestRepository
POST/api/latest/projects/{projectKey}/repos
1 2 3 4 5 6 7 8 9 10 11 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "scmId": "git", "slug": "my-repo", "name": "My repo", "project": "PROJ", "links": {} }'
201Response
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 { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }
GET

Get api latest projects {projectKey} repos {repositorySlug}

Retrieve the repository matching the supplied projectKey and repositorySlug.

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Responses

The repository which matches the supplied projectKey and repositorySlug.

application/json

RestRepository
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}' \ --header 'Accept: application/json'
201Response
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 { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }
PUT

Put api latest projects {projectKey} repos {repositorySlug}

Update the repository matching the repositorySlug supplied in the resource path.

The repository's slug is derived from its name. If the name changes the slug may also change.

This resource can be used to change the repository's default branch by specifying a new default branch in the request. For example: "defaultBranch":"main"

This resource can be used to move the repository to a different project by specifying a new project in the request. For example: "project":{"key":"NEW_KEY"}

The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The updated repository.

scmId

string

slug

string

name

string

project

string

links

object

Responses

The updated repository.

application/json

RestRepository
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}
1 2 3 4 5 6 7 8 9 10 11 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "scmId": "git", "slug": "my-repo", "name": "My repo", "project": "PROJ", "links": {} }'
201Response
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 { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }
POST

Post api latest projects {projectKey} repos {repositorySlug}

Create a new repository forked from an existing repository.

The JSON body for this POST is not required to contain any properties. Even the name may be omitted. The following properties will be used, if provided:

  • "name":"Fork name" - Specifies the forked repository's name
    • Defaults to the name of the origin repository if not specified
  • "defaultBranch":"main" - Specifies the forked repository's default branch
    • Defaults to the origin repository's default branch if not specified
  • "project":{"key":"TARGET_KEY"} - Specifies the forked repository's target project by key
    • Defaults to the current user's personal project if not specified

The authenticated user must have REPO_READ permission for the specified repository and PROJECT_ADMIN on the target project to call this resource. Note that users always have PROJECT_ADMIN permission on their personal projects.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The rest fork.

scmId

string

slug

string

name

string

project

string

links

object

Responses

The newly created fork.

application/json

RestRepository
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}
1 2 3 4 5 6 7 8 9 10 11 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "scmId": "git", "slug": "my-repo", "name": "My repo", "project": "PROJ", "links": {} }'
201Response
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 { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }
DEL

Delete api latest projects {projectKey} repos {repositorySlug}

Schedule the repository matching the supplied projectKey and repositorySlug to be deleted.

The authenticated user must have sufficient permissions specified by the repository delete policy to call this resource. The default permission required is REPO_ADMIN permission.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Responses

The repository has been scheduled for deletion.

application/json

any

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}' \ --header 'Accept: application/json'
GET

Get api latest projects {projectKey} repos {repositorySlug} archive

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

    • If the branch or tag is qualified (e.g. refs/heads/master, the short name (master) will be included in the filename
    • If the branch or tag's short name includes slashes (e.g. release/4.6), they will be converted to hyphens in the filename (release-4.5)

Archives may be requested in the following formats by adding the format= query parameter:

  • zip: A zip file using standard compression (Default)
  • tar: An uncompressed tarball
  • tar.gz or tgz: A GZip-compressed tarball

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

path

string

filename

string

at

string

prefix

string

format

string

Responses

An archive or the requested commit, in zip, tar or gzipped-tar format.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/archive
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/archive' \ --header 'Accept: application/json'
GET

Get api latest projects {projectKey} repos {repositorySlug} attachments {attachmentId}

Retrieve the attachment.

The authenticated user must have REPO_READ permission for the specified repository that is associated to the attachment.

Request

Path parameters

projectKey

string

Required
attachmentId

string

Required
repositorySlug

string

Required

Header parameters

User-Agent

string

Responses

the attachment

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}' \ --header 'Accept: application/json'
DEL

Delete api latest projects {projectKey} repos {repositorySlug} attachments {attachmentId}

Delete an attachment.

The user must be authenticated and have REPO_ADMIN permission for the specified repository.

Request

Path parameters

projectKey

string

Required
attachmentId

string

Required
repositorySlug

string

Required

Responses

This status code has no content.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}'
GET

Get api latest projects {projectKey} repos {repositorySlug} attachments {attachmentId} metadata

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.

Request

Path parameters

projectKey

string

Required
attachmentId

string

Required
repositorySlug

string

Required

Responses

The attachment metadata

application/json

RestAttachmentMetadata
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}/metadata
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}/metadata' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 { "id": 1, "url": "test.com/test", "metadata": "{\\\"A\\\":\\\"B\\\"}" }
PUT

Put api latest projects {projectKey} repos {repositorySlug} attachments {attachmentId} metadata

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.

Request

Path parameters

projectKey

string

Required
attachmentId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The attachment metadata can be any valid JSON content

string

Responses

The attachment metadata

application/json

any

PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}/metadata
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>"'
DEL

Delete api latest projects {projectKey} repos {repositorySlug} attachments {attachmentId} metadata

Delete attachment metadata.

The user must be authenticated and have REPO_ADMIN permission for the specified repository.

Request

Path parameters

projectKey

string

Required
attachmentId

string

Required
repositorySlug

string

Required

Responses

This status code has no content.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}/metadata
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}/metadata'
GET

Get api latest projects {projectKey} repos {repositorySlug} branches

Retrieve the branches matching the supplied filterText param.

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

boostMatches

boolean

orderBy

string

details

boolean

filterText

string

base

string

start

number

limit

number

Responses

The branches matching the supplied filterText.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 { "values": [ { "displayId": "<string>", "default": true, "latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13", "latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13", "id": "refs/heads/master" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest projects {projectKey} repos {repositorySlug} branches

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The request to create a branch containing a name, startPoint, and optionally a message

message

string

name

string

startPoint

string

Responses

The created branch.

application/json

RestBranch
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches
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" }'
200Response
1 2 3 4 5 6 7 { "displayId": "<string>", "default": true, "latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13", "latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13", "id": "refs/heads/master" }
GET

Get api latest projects {projectKey} repos {repositorySlug} branches defaultDeprecated

Retrieves the repository's default branch, if it has been created. If the repository is empty, 204 No Content will be returned. For non-empty repositories, if the configured default branch has not yet been created a 404 Not Found will be returned.

This URL is deprecated. Callers should use GET /projects/{key}/repos/{slug}/default-branch instead, which allows retrieving the configured default branch even if the ref has not been created yet.

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Responses

The configured default branch for the repository.

application/json

RestBranch
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches/default
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches/default' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 { "displayId": "<string>", "default": true, "latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13", "latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13", "id": "refs/heads/master" }
PUT

Put api latest projects {projectKey} repos {repositorySlug} branches defaultDeprecated

Update the default branch of a repository.

This URL is deprecated. Callers should use PUT /projects/{key}/repos/{slug}/default-branch instead.

The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The branch to set as default

type

RefType

id

string

Responses

The operation was successful.

PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches/default
1 2 3 4 5 6 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches/default' \ --header 'Content-Type: application/json' \ --data '{ "id": "refs/heads/master" }'
GET

Get api latest projects {projectKey} repos {repositorySlug} browse

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.

  1. size will return a response like {"size":10000}
  2. type will return a response like {"type":"FILE"}, where possible values are "DIRECTORY", "FILE" and "SUBMODULE"
  3. blame without noContent will include blame for the lines of content returned on the page
  4. blame with noContent will omit file contents and only return blame for the requested lines
  5. noContent without blame is ignored and does nothing

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".

  • ?blame is the same as ?blame=true
  • ?blame&noContent is the same as ?blame=true&noContent=true
  • ?size is the same as ?size=false
  • ?type is the same as ?type=false

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

noContent

string

at

string

size

string

blame

string

type

string

Responses

A page of contents from a file.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse' \ --header 'Accept: application/json'
GET

Get api latest projects {projectKey} repos {repositorySlug} browse {path}

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.

  1. size will return a response like {"size":10000}
  2. type will return a response like {"type":"FILE"}, where possible values are "DIRECTORY", "FILE" and "SUBMODULE"
  3. blame without noContent will include blame for the lines of content returned on the page
  4. blame with noContent will omit file contents and only return blame for the requested lines
  5. noContent without blame is ignored and does nothing

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".

  • ?blame is the same as ?blame=true
  • ?blame&noContent is the same as ?blame=true&noContent=true
  • ?size is the same as ?size=false
  • ?type is the same as ?type=false

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

path

string

Required
projectKey

string

Required
repositorySlug

string

Required

Query parameters

noContent

string

at

string

size

string

blame

string

type

string

Responses

A page of contents from a file.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse/{path}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse/{path}' \ --header 'Accept: application/json'
PUT

Put api latest projects {projectKey} repos {repositorySlug} browse {path}

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

  • branch: the branch on which the path should be modified or created
  • content: the full content of the file at path
  • message: the message associated with this change, to be used as the commit message. Or null if the default message should be used.
  • sourceCommitId: the commit ID of the file before it was edited, used to identify if content has changed. Or null if this is a new file

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.

Request

Path parameters

path

string

Required
projectKey

string

Required
repositorySlug

string

Required

Request bodymultipart/form-data

The multipart form data containing the file

branch

string

content

string

message

string

sourceBranch

string

sourceCommitId

string

Responses

The newly created commit.

application/json

RestCommit
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse/{path}
1 2 3 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse/{path}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 { "committer": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "authorTimestamp": 1359075920, "committerTimestamp": 1449075830, "author": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "message": "More work on feature 1", "parents": [ { "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } ], "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" }
GET

Get api latest projects {projectKey} repos {repositorySlug} changes

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

until

string

since

string

start

number

limit

number

Responses

A page of changes

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/changes
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/changes' \ --header 'Accept: application/json'
200Response
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": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "conflict": { "ourChange": { "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "type": "ADD", "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] } }, "theirChange": { "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "type": "ADD", "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] } } }, "contentId": "abcdef0123abcdef4567abcdef8987abcdef6543", "fromContentId": "bcdef0123abcdef4567abcdef8987abcdef6543a", "percentUnchanged": 98, "srcExecutable": true, "type": "ADD", "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "nodeType": "DIRECTORY", "executable": true } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} repos {repositorySlug} commits

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

avatarScheme

string

path

string

withCounts

string

followRenames

string

until

string

avatarSize

string

since

string

merges

string

ignoreMissing

string

start

number

Responses

A page of commits

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits' \ --header 'Accept: application/json'
200Response
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": [ { "committer": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "authorTimestamp": 1359075920, "committerTimestamp": 1449075830, "author": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "message": "More work on feature 1", "parents": [ { "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } ], "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} repos {repositorySlug} commits {commitId}

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.

Request

Path parameters

projectKey

string

Required
commitId

string

Required
repositorySlug

string

Required

Query parameters

path

string

Responses

A commit

application/json

RestCommit
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 { "committer": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "authorTimestamp": 1359075920, "committerTimestamp": 1449075830, "author": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "message": "More work on feature 1", "parents": [ { "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } ], "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" }
GET

Get api latest projects {projectKey} repos {repositorySlug} commits {commitId} builds

Get a specific build status.

The authenticated user must have REPO_READ permission for the provided repository.The request can also be made with anonymous 2-legged OAuth.
Since 7.14

Request

Path parameters

projectKey

string

Required
commitId

string

Required
repositorySlug

string

Required

Query parameters

key

string

Responses

The build status associated with the provided commit and key

application/json

RestBuildStatus
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/builds
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/builds' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 { "testResults": { "failed": 1, "successful": 134, "skipped": 5 }, "createdDate": 1587533099278, "updatedDate": 1587533699278, "name": "Database Matrix Tests", "key": "TEST-REP3", "parent": "TEST-REP", "state": "CANCELLED", "ref": "refs/heads/master", "description": "A description of the build goes here", "duration": 2154, "url": "https://bamboo.example.com/browse/TEST-REP3", "buildNumber": "3" }
POST

Post api latest projects {projectKey} repos {repositorySlug} commits {commitId} builds

Store a build status.

The authenticated user must have REPO_READ permission for the repository that this build status is for. The request can also be made with anonymous 2-legged OAuth.

Request

Path parameters

projectKey

string

Required
commitId

string

Required
repositorySlug

string

Required

Request body*/*

The contents of the build status request are: These fields are required:

  • key: The string referring to this branch plan/job
  • state: The build status state, one of: "SUCCESSFUL", "FAILED", "INPROGRESS"
  • url: URL referring to the build result page in the CI tool.

These fields are optional:

  • buildNumber (optional): A unique identifier for this particular run of a plan<
  • dateAdded (optional): milliseconds since epoch. If not provided current date is used.
  • description (optional): Describes the build result
  • duration (optional): Duration of a completed build in milliseconds.
  • name (optional): A short string that describes the build plan
  • parent (optional): The identifier for the plan or job that ran the branch plan that produced this build status.
  • ref (optional): The fully qualified git reference e.g. refs/heads/master.
  • testResults (optional): A summary of the passed, failed and skipped tests.
buildNumber

string

description

string

duration

integer

key

string

Required
lastUpdated

integer

name

string

parent

string

ref

string

state

string

Required
testResults

object

Responses

The build status was posted

POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/builds
1 2 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/builds'
DEL

Delete api latest projects {projectKey} repos {repositorySlug} commits {commitId} builds

Delete a specific build status.

The authenticated user must have REPO_ADMIN permission for the provided repository.

Request

Path parameters

projectKey

string

Required
commitId

string

Required
repositorySlug

string

Required

Query parameters

key

string

Responses

The build status associated with the provided commit and key has been deleted

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/builds
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/builds'
GET

Get api latest projects {projectKey} repos {repositorySlug} commits {commitId} changes

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.

Request

Path parameters

projectKey

string

Required
commitId

string

Required
repositorySlug

string

Required

Query parameters

withComments

string

since

string

start

number

limit

number

Responses

A page of changes

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/changes
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/changes' \ --header 'Accept: application/json'
200Response
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": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "conflict": { "ourChange": { "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "type": "ADD", "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] } }, "theirChange": { "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "type": "ADD", "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] } } }, "contentId": "abcdef0123abcdef4567abcdef8987abcdef6543", "fromContentId": "bcdef0123abcdef4567abcdef8987abcdef6543a", "percentUnchanged": 98, "srcExecutable": true, "type": "ADD", "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "nodeType": "DIRECTORY", "executable": true } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} repos {repositorySlug} commits {commitId} comments

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.

Request

Path parameters

projectKey

string

Required
commitId

string

Required
repositorySlug

string

Required

Query parameters

path

string

since

string

start

number

limit

number

Responses

A page of comments that match the search criteria

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "parent": { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }, "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest projects {projectKey} repos {repositorySlug} commits {commitId} comments

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.

Request

Path parameters

projectKey

string

Required
commitId

string

Required
repositorySlug

string

Required

Query parameters

since

string

Request bodyapplication/json

the comment

version

integer

severity

string

id

integer

state

string

text

string

properties

object

Responses

The newly created comment.

application/json

RestComment
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments
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 '{ "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "properties": {} }'
201Response
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 { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "parent": { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }, "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }
GET

Get api latest projects {projectKey} repos {repositorySlug} commits {commitId} comments {commentId}

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.

Request

Path parameters

projectKey

string

Required
commentId

string

Required
commitId

string

Required
repositorySlug

string

Required

Responses

The requested comment.

application/json

RestComment
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}' \ --header 'Accept: application/json'
200Response
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 { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "parent": { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }, "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }
PUT

Put api latest projects {projectKey} repos {repositorySlug} commits {commitId} comments {commentId}

Update a comment, with the following restrictions:

  • only the author of the comment may update the text of the comment
  • only the author of the comment or repository admins and above may update the other fields of a comment

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.

Request

Path parameters

projectKey

string

Required
commentId

string

Required
commitId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The comment to update

version

integer

severity

string

id

integer

state

string

text

string

properties

object

Responses

The newly updated comment.

application/json

RestComment
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}
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 '{ "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "properties": {} }'
201Response
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 { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "parent": { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }, "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }
DEL

Delete api latest projects {projectKey} repos {repositorySlug} commits {commitId} comments {commentId}

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.

Request

Path parameters

projectKey

string

Required
commentId

string

Required
commitId

string

Required
repositorySlug

string

Required

Query parameters

version

string

Responses

The operation was successful

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}'
GET

Get api latest projects {projectKey} repos {repositorySlug} commits {commitId} deployments

Get the deployment matching the specified Repository, key, environmentKey and deploymentSequenceNumber.

The user must have REPO_READ.

Request

Path parameters

projectKey

string

Required
commitId

string

Required
repositorySlug

string

Required

Query parameters

deploymentSequenceNumber

string

key

string

environmentKey

string

Responses

The deployment

application/json

RestDeployment
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/deployments
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/deployments' \ --header 'Accept: application/json'
200Response
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 { "environment": { "displayName": "US East Mirror", "key": "us-east-mirror", "type": "production", "url": "https://foo-bar.production/us-east" }, "deploymentSequenceNumber": 5, "fromCommit": { "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" }, "toCommit": { "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" }, "displayName": "US East Mirror", "key": "PROD-MIR", "state": "PENDING", "description": "Production and mirror environments", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "url": "http://example.ci.org/projects/PROJ/deploy/mirror-deploy/100", "lastUpdated": 1449075920 }
POST

Post api latest projects {projectKey} repos {repositorySlug} commits {commitId} deployments

Create or update a deployment.

The authenticated user must have REPO_READ permission for the repository.

Request

Path parameters

projectKey

string

Required
commitId

string

Required
repositorySlug

string

Required

Request body*/*

the details of the deployment to create, as detailed by the request body

deploymentSequenceNumber

integer

Required
description

string

Required
displayName

string

Required
environment

RestDeploymentEnvironment

Required
key

string

Required
lastUpdated

integer

state

string

Required
url

string

Required

Responses

The deployment was created

application/json

RestDeployment
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/deployments
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/deployments' \ --header 'Accept: application/json'
200Response
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 { "environment": { "displayName": "US East Mirror", "key": "us-east-mirror", "type": "production", "url": "https://foo-bar.production/us-east" }, "deploymentSequenceNumber": 5, "fromCommit": { "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" }, "toCommit": { "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" }, "displayName": "US East Mirror", "key": "PROD-MIR", "state": "PENDING", "description": "Production and mirror environments", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "url": "http://example.ci.org/projects/PROJ/deploy/mirror-deploy/100", "lastUpdated": 1449075920 }
DEL

Delete api latest projects {projectKey} repos {repositorySlug} commits {commitId} deployments

Delete the deployment matching the specified Repository, key, environmentKey and deploymentSequenceNumber.

The user must have REPO_ADMIN.

Request

Path parameters

projectKey

string

Required
commitId

string

Required
repositorySlug

string

Required

Query parameters

deploymentSequenceNumber

string

key

string

environmentKey

string

Responses

the request has been processed

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/deployments
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/deployments'
GET

Get api latest projects {projectKey} repos {repositorySlug} commits {commitId} diff

Request

Path parameters

projectKey

string

Required
commitId

string

Required
repositorySlug

string

Required

Query parameters

contextLines

integer

srcPath

string

autoSrcPath

boolean

whitespace

string

since

string

Responses

default response

text/plain; qs=0.1

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diff
1 2 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diff'
GET

Get api latest projects {projectKey} repos {repositorySlug} commits {commitId} diff {path}

Stream the diff between two provided revisions.

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

path

string

Required
projectKey

string

Required
commitId

string

Required
repositorySlug

string

Required

Query parameters

contextLines

string

srcPath

string

autoSrcPath

string

whitespace

string

since

string

Responses

A raw diff between two revisions

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diff/{path}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diff/{path}' \ --header 'Accept: application/json'
GET

Get api latest projects {projectKey} repos {repositorySlug} commits {commitId} pull-requests

Retrieve a page of pull requests in the current repository that contain the given commit. The user must be authenticated and have access to the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
commitId

string

Required
repositorySlug

string

Required

Query parameters

start

number

limit

number

Responses

Return a page of pull requests in the current repository containing the given commit.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/pull-requests
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/pull-requests' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest projects {projectKey} repos {repositorySlug} commits {commitId} watch

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.

Request

Path parameters

projectKey

string

Required
commitId

string

Required
repositorySlug

string

Required

Responses

The user is now watching the commit.

POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/watch
1 2 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/watch'
DEL

Delete 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.

Request

Path parameters

projectKey

string

Required
commitId

string

Required
repositorySlug

string

Required

Responses

The user is no longer watching the commit.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/watch
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/watch'
GET

Get api latest projects {projectKey} repos {repositorySlug} compare changes

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

fromRepo

string

from

string

to

string

start

number

limit

number

Responses

A page of changes.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/changes
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/changes' \ --header 'Accept: application/json'
200Response
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": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "conflict": { "ourChange": { "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "type": "ADD", "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] } }, "theirChange": { "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "type": "ADD", "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] } } }, "contentId": "abcdef0123abcdef4567abcdef8987abcdef6543", "fromContentId": "bcdef0123abcdef4567abcdef8987abcdef6543a", "percentUnchanged": 98, "srcExecutable": true, "type": "ADD", "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "nodeType": "DIRECTORY", "executable": true } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} repos {repositorySlug} compare commits

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

fromRepo

string

from

string

to

string

start

number

limit

number

Responses

A page of commits.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/commits
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/commits' \ --header 'Accept: application/json'
200Response
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": [ { "committer": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "authorTimestamp": 1359075920, "committerTimestamp": 1449075830, "author": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "message": "More work on feature 1", "parents": [ { "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } ], "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} repos {repositorySlug} compare diff{path}

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.

Request

Path parameters

path

string

Required
projectKey

string

Required
repositorySlug

string

Required

Query parameters

contextLines

string

fromRepo

string

srcPath

string

from

string

to

string

whitespace

string

start

number

limit

number

Responses

The diff of the changes.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/diff{path}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/diff{path}' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "hunks": [ { "truncated": true, "sourceLine": 2154, "sourceSpan": 2154, "destinationLine": 2154, "destinationSpan": 2154, "segments": [ {} ], "context": "<string>" } ], "truncated": true, "lineComments": [ { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ {} ], "reviewers": [ {} ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "parent": { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ {} ], "reviewers": [ {} ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }, "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} } ], "source": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "binary": true, "destination": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "properties": {} } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} repos {repositorySlug} contributing

Retrieves the contributing guidelines for the repository, if they've been defined.

This checks the repository for a CONTRIBUTING file, optionally with an md or txt extension, and, if found, streams it. By default, the raw content of the file is streamed. Appending ?markup to the URL will stream an HTML-rendered version instead.

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

at

string

markup

string

htmlEscape

string

includeHeadingId

string

hardwrap

string

Responses

The contributing guidelines for the repository.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/contributing
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/contributing' \ --header 'Accept: application/json'
HEAD

Head api latest projects {projectKey} repos {repositorySlug} contributing

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Responses

default response

application/json;charset=UTF-8

any

HEAD/api/latest/projects/{projectKey}/repos/{repositorySlug}/contributing
1 2 curl --request HEAD \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/contributing'
GET

Get api latest projects {projectKey} repos {repositorySlug} default-branch

Retrieves the repository's configured default branch.

Every repository has a configured default branch, but that branch may not actually exist in the repository. For example, a newly-created repository will have a configured default branch even though no branches have been pushed yet.

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Responses

The configured default branch for the repository.

application/json

RestMinimalRef
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/default-branch
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/default-branch' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 { "displayId": "master", "id": "refs/heads/master", "type": "BRANCH" }
PUT

Put api latest projects {projectKey} repos {repositorySlug} default-branch

Update the default branch of a repository.

The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The branch to set as default

type

RefType

id

string

Responses

The default branch was updated.

PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/default-branch
1 2 3 4 5 6 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/default-branch' \ --header 'Content-Type: application/json' \ --data '{ "id": "refs/heads/master" }'
GET

Get api latest projects {projectKey} repos {repositorySlug} diff

Stream the raw diff between two provided revisions.

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

contextLines

string

srcPath

string

until

string

whitespace

string

since

string

Responses

A raw diff between two revisions.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/diff
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/diff' \ --header 'Accept: application/json'
GET

Get api latest projects {projectKey} repos {repositorySlug} diff {path}

Stream the raw diff between two provided revisions.

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

path

string

Required
projectKey

string

Required
repositorySlug

string

Required

Query parameters

contextLines

string

srcPath

string

until

string

whitespace

string

since

string

Responses

A raw diff between two revisions.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/diff/{path}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/diff/{path}' \ --header 'Accept: application/json'
GET

Get api latest projects {projectKey} repos {repositorySlug} files

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

at

string

start

number

limit

number

Responses

A page of files.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/files
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/files' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 { "values": [], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} repos {repositorySlug} files {path}

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.

Request

Path parameters

path

string

Required
projectKey

string

Required
repositorySlug

string

Required

Query parameters

at

string

start

number

limit

number

Responses

A page of files.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/files/{path}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/files/{path}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 { "values": [], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} repos {repositorySlug} forks

Retrieve repositories which have been forked from this one. Unlike #getRelatedRepositories(Repository, PageRequest) related repositories, this only looks at a given repository's direct forks. If those forks have themselves been the origin of more forks, such "grandchildren" repositories will not be retrieved.

Only repositories to which the authenticated user has REPO_READ permission will be included, even if other repositories have been forked from this one.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

start

number

limit

number

Responses

A page of repositories related to the request repository.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/forks
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/forks' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} repos {repositorySlug} hook-scripts

Return a page of hook scripts configured for the specified repository.

This endpoint requires REPO_ADMIN permission.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

start

number

limit

number

Responses

A page of hook scripts.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/hook-scripts
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/hook-scripts' \ --header 'Accept: application/json'
201Response
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": [ { "script": { "createdDate": "<string>", "updatedDate": "<string>", "version": 2154, "name": "<string>", "id": 2154, "type": "POST", "description": "<string>", "pluginKey": "<string>" }, "scope": { "resourceId": 2, "type": "GLOBAL" }, "triggerIds": [ "<string>" ] } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
PUT

Put api latest projects {projectKey} repos {repositorySlug} hook-scripts {scriptId}

Creates/updates the hook script configuration for the provided hook script and repository.

This endpoint requires REPO_ADMIN permission.

Request

Path parameters

projectKey

string

Required
scriptId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The hook triggers for which the hook script should be run

triggerIds

array<string>

Responses

The updated hook script.

application/json

RestHookScriptConfig
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/hook-scripts/{scriptId}
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>" ] }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 { "script": { "createdDate": "<string>", "updatedDate": "<string>", "version": 2154, "name": "<string>", "id": 2154, "type": "POST", "description": "<string>", "pluginKey": "<string>" }, "scope": { "resourceId": 2, "type": "GLOBAL" }, "triggerIds": [ "<string>" ] }
DEL

Delete api latest projects {projectKey} repos {repositorySlug} hook-scripts {scriptId}

Removes the hook script from the set of hook scripts configured to run in the repository.

This endpoint requires REPO_ADMIN permission.

Request

Path parameters

projectKey

string

Required
scriptId

string

Required
repositorySlug

string

Required

Responses

The hook script was successfully deleted.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/hook-scripts/{scriptId}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/hook-scripts/{scriptId}'
GET

Get api latest projects {projectKey} repos {repositorySlug} labels

Get all labels applied to the given repository.

The authenticated user must have REPO_READ permission for the specified repository.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Responses

The applied label.

application/json

RestLabel
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/labels
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/labels' \ --header 'Accept: application/json'
200Response
1 2 3 { "name": "labelName" }
POST

Post api latest projects {projectKey} repos {repositorySlug} labels

Applies a label to the repository.

The authenticated user must have REPO_ADMIN permission for the specified repository.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The label to apply

name

string

Responses

The applied label.

application/json

RestLabel
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/labels
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" }'
200Response
1 2 3 { "name": "labelName" }
DEL

Delete api latest projects {projectKey} repos {repositorySlug} labels {labelName}

Remove label that is applied to the given repository.

The authenticated user must have REPO_ADMIN permission for the specified repository.

Request

Path parameters

projectKey

string

Required
labelName

string

Required
repositorySlug

string

Required

Responses

An empty response indicating that the label is no longer associated to the repository.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/labels/{labelName}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/labels/{labelName}'
GET

Get api latest projects {projectKey} repos {repositorySlug} last-modified

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

at

string

Responses

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).

application/json

ExampleFiles
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/last-modified
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/last-modified' \ --header 'Accept: application/json'
200Response
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": { "latestCommit": { "committer": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "authorTimestamp": 1359075920, "committerTimestamp": 1449075830, "author": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "message": "More work on feature 1", "parents": [ { "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } ], "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" }, "pomXml": { "committer": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "authorTimestamp": 1359075920, "committerTimestamp": 1449075830, "author": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "message": "More work on feature 1", "parents": [ { "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } ], "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" }, "readmeMd": { "committer": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "authorTimestamp": 1359075920, "committerTimestamp": 1449075830, "author": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "message": "More work on feature 1", "parents": [ { "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } ], "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } } }
GET

Get api latest projects {projectKey} repos {repositorySlug} last-modified {path}

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.

Request

Path parameters

path

string

Required
projectKey

string

Required
repositorySlug

string

Required

Query parameters

at

string

Responses

A map of files to the last commit that modified them, and the latest commit to update the requested path.

application/json

ExampleFiles
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/last-modified/{path}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/last-modified/{path}' \ --header 'Accept: application/json'
200Response
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": { "latestCommit": { "committer": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "authorTimestamp": 1359075920, "committerTimestamp": 1449075830, "author": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "message": "More work on feature 1", "parents": [ { "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } ], "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" }, "pomXml": { "committer": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "authorTimestamp": 1359075920, "committerTimestamp": 1449075830, "author": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "message": "More work on feature 1", "parents": [ { "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } ], "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" }, "readmeMd": { "committer": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "authorTimestamp": 1359075920, "committerTimestamp": 1449075830, "author": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "message": "More work on feature 1", "parents": [ { "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } ], "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } } }
GET

Get api latest projects {projectKey} repos {repositorySlug} license

Retrieves the license for the repository, if it's been defined.

This checks the repository for a

LICENSE
file, optionally with an
md
or
txt
extension, and, if found, streams it. By default, the raw content of the file is streamed. Appending
?markup
to the URL will stream an HTML-rendered version instead.

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

at

string

markup

string

htmlEscape

string

includeHeadingId

string

hardwrap

string

Responses

The license for the repository.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/license
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/license' \ --header 'Accept: application/json'
HEAD

Head api latest projects {projectKey} repos {repositorySlug} license

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Responses

default response

application/json;charset=UTF-8

any

HEAD/api/latest/projects/{projectKey}/repos/{repositorySlug}/license
1 2 curl --request HEAD \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/license'
GET

Get api latest projects {projectKey} repos {repositorySlug} participants

Retrieve a page of participant users for all the pull requests to or from the specified repository. Optionally clients can specify following filters.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

filter

string

role

string

direction

string

start

number

limit

number

Responses

A page of users that match the search criteria.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/participants
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/participants' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 { "values": [ { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} repos {repositorySlug} patch

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

until

string

allAncestors

string

since

string

Responses

The patch contents from a repository.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/patch
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/patch' \ --header 'Accept: application/json'
DEL

Delete api latest projects {projectKey} repos {repositorySlug} permissions

Revoke all permissions for the specified repository for the given groups and users.

The authenticated user must have PROJECT_ADMIN permission for the specified repository or a higher global permission to call this resource.

In addition, a user may not revoke a group's permission if their own permission would be revoked as a result, nor may they revoke their own permission unless they have a global permission that already implies that permission.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

user

string

group

string

Responses

All repository permissions were revoked from the users and groups for the specified repository.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions'
GET

Get api latest projects {projectKey} repos {repositorySlug} permissions groups

Retrieve a page of groups that have been granted at least one permission for the specified repository.

The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

filter

string

start

number

limit

number

Responses

A page of groups and their highest permissions for the specified repository.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groups
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groups' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "values": [ { "permission": "ADMIN", "group": { "name": "group_a" } } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
PUT

Put api latest projects {projectKey} repos {repositorySlug} permissions groups

Promote or demote a group's permission level for the specified repository. Available repository permissions are:

  • REPO_READ
  • REPO_WRITE
  • REPO_ADMIN

See the Bitbucket Server documentation for a detailed explanation of what each permission entails.

The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource. In addition, a user may not demote a group's permission level if their own permission level would be reduced as a result.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

name

array<string>

Required
permission

string

Required

Responses

The requested permission was granted.

PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groups
1 2 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groups?name={name}&permission={permission}'
DEL

Delete api latest projects {projectKey} repos {repositorySlug} permissions groups

Revoke all permissions for the specified repository for a group.

The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource.

In addition, a user may not revoke a group's permissions if it will reduce their own permission level.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

name

string

Required

Responses

All repository permissions were revoked from the group for the specified repository.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groups
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groups?name={name}'
GET

Get api latest projects {projectKey} repos {repositorySlug} permissions groups none

Retrieve a page of groups that have no granted permissions for the specified repository.

The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

filter

string

start

number

limit

number

Responses

A page of groups that have not been granted any permissions for the specified repository.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groups/none
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groups/none' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 { "values": [ { "deletable": true, "name": "group-a" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} repos {repositorySlug} permissions users

Retrieve a page of users that have been granted at least one permission for the specified repository.

The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

filter

string

start

number

limit

number

Responses

A page of users and their highest permissions for the specified repository.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/users
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/users' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 { "values": [ { "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "permission": "USER_ADMIN" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
PUT

Put api latest projects {projectKey} repos {repositorySlug} permissions users

Promote or demote a user's permission level for the specified repository. Available repository permissions are:

  • REPO_READ
  • - REPO_WRITE- REPO_ADMIN
See the Bitbucket Server documentation for a detailed explanation of what each permission entails.

The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource. In addition, a user may not reduce their own permission level unless they have a project or global permission that already implies that permission.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

name

array<string>

Required
permission

string

Required

Responses

The requested permission was granted.

PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/users
1 2 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/users?name={name}&permission={permission}'
DEL

Delete api latest projects {projectKey} repos {repositorySlug} permissions users

Revoke all permissions for the specified repository for a user.

The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource.

In addition, a user may not revoke their own repository permissions if they do not have a higher project or global permission.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

name

string

Required

Responses

All repository permissions were revoked from the user for the specified repository.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/users
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/users?name={name}'
GET

Get api latest projects {projectKey} repos {repositorySlug} permissions users none

Retrieve a page of licensed users that have no granted permissions for the specified repository.

The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

filter

string

start

number

limit

number

Responses

A page of users that have not been granted any permissions for the specified repository.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/users/none
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/users/none' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 { "values": [ { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests

Retrieve a page of pull requests to or from the specified repository.

The authenticated user must have REPO_READ permission for the specified repository to call this resource. Optionally clients can specify PR participant filters. Each filter has a mandatory username.N parameter, and the optional role.N and approved.N parameters.

  • username.N - the "root" of a single participant filter, where "N" is a natural number starting from 1. This allows clients to specify multiple participant filters, by providing consecutive filters as username.1, username.2 etc. Note that the filters numbering has to start with 1 and be continuous for all filters to be processed. The total allowed number of participant filters is 10 and all filters exceeding that limit will be dropped.
  • role.N(optional) the role associated with username.N. This must be one of AUTHOR, REVIEWER, or PARTICIPANT
  • approved.N (optional) the approved status associated with username.N. That is whether username.N has approved the PR. Either true, or false

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

withAttributes

string

at

string

withProperties

string

filterText

string

state

string

order

string

direction

string

start

number

limit

number

Responses

A page of pull requests that match the search criteria.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest projects {projectKey} repos {repositorySlug} pull-requests

Create a new pull request from a source branch or tag to a target branch. The source and target may be in the same repository, or different ones. (Note that different repositories must belong to the same Repository#getHierarchyId() hierarchy.)

The fromRef may be a branch or a tag. The toRef is required to be a branch. Tags are not allowed as targets because tags are intended to be immutable and should not be changed after they are created.

The authenticated user must have REPO_READ permission for the fromRef and toRef repositories to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The pull request data

fromRef

object

toRef

object

participants

array<RestPullRequestParticipant>

reviewers

array<RestPullRequestParticipant>

htmlDescription

string

closedDate

integer

createdDate

integer

updatedDate

integer

version

integer

open

boolean

Responses

The newly created pull request.

application/json

RestPullRequest
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests
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 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "slug": "my-repo", "name": "My repo", "project": "PROJ", "links": {} } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "slug": "my-repo", "name": "My repo", "project": "PROJ", "links": {} } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "type": "NORMAL", "active": true, "links": {}, "avatarUrl": "<string>" }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "type": "NORMAL", "active": true, "links": {}, "avatarUrl": "<string>" }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "htmlDescription": "<string>", "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy", "links": {} }'
201Response
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 { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId}

Retrieve a pull request.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

The specified pull request.

application/json

RestApplicationUser
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }
PUT

Put api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId}

Update the title, description, reviewers or destination branch of an existing pull request.

Note: the reviewers list may be updated using this resource. However the author and participants list may not.

The authenticated user must either:

  • be the author of the pull request and have the REPO_READ permission for the repository that this pull request targets; or
  • have the REPO_WRITE permission for the repository that this pull request targets

to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The updated pull request

fromRef

object

toRef

object

participants

array<RestPullRequestParticipant>

reviewers

array<RestPullRequestParticipant>

htmlDescription

string

closedDate

integer

createdDate

integer

updatedDate

integer

version

integer

open

boolean

Responses

The updated pull request.

application/json

RestPullRequest
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}
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 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "slug": "my-repo", "name": "My repo", "project": "PROJ", "links": {} } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "slug": "my-repo", "name": "My repo", "project": "PROJ", "links": {} } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "type": "NORMAL", "active": true, "links": {}, "avatarUrl": "<string>" }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "type": "NORMAL", "active": true, "links": {}, "avatarUrl": "<string>" }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "htmlDescription": "<string>", "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy", "links": {} }'
200Response
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 { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }
DEL

Delete api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId}

Deletes a pull request.

To call this resource, users must be authenticated and have permission to view the pull request. Additionally, they must:

  • be the pull request author, if the system is configured to allow authors to delete their own pull requests (this is the default) OR
  • have repository administrator permission for the repository the pull request is targeting

A body containing the version of the pull request must be provided with this request.

{ "version": 1 }

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

A body containing the version of the pull request

version

integer

Responses

The pull request was deleted.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}
1 2 3 4 5 6 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}' \ --header 'Content-Type: application/json' \ --data '{ "version": 2154 }'
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId}.diff

Streams the raw diff for a pull request.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

contextLines

string

whitespace

string

Responses

A raw diff for the specified pull request.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}.diff
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}.diff' \ --header 'Accept: application/json'
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId}.patch

Streams a patch representing a pull request.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

A patch representing the specified pull request.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}.patch
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}.patch' \ --header 'Accept: application/json'
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} activities

Retrieve a page of activity associated with a pull request.

Activity items include comments, approvals, rescopes (i.e. adding and removing of commits), merges and more.

Different types of activity items may be introduced in newer versions of Stash or by user installed plugins, so clients should be flexible enough to handle unexpected entity shapes in the returned page.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

fromType

string

fromId

string

start

number

limit

number

Responses

A page of activity relating to the specified pull request.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/activities
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/activities' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 { "values": [ { "action": "APPROVED", "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "createdDate": 19990759200, "id": 1 } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} approveDeprecated

Approve a pull request as the current user. Implicitly adds the user as a participant if they are not already.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Deprecated since 4.2. Use /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug} instead

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

Details of the new participant.

application/json

RestPullRequestParticipant
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/approve
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/approve' \ --header 'Accept: application/json'
201Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" }
DEL

Delete api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} approveDeprecated

Remove approval from a pull request as the current user. This does not remove the user as a participant.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Deprecated since 4.2. Use /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug} instead

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

Details of the updated participant.

application/json

RestPullRequestParticipant
DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/approve
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/approve' \ --header 'Accept: application/json'
201Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" }
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} blocker-comments

Gets comments matching the given set of field values for the specified pull request. (Note this does not perform any kind of searching for comments by their text).

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

count

string

state

array<string>

states

string

start

number

limit

number

Responses

A page of Comments from the supplied pull request.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "parent": { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }, "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} blocker-comments

Add a new blocker comment.

Comments can be added in a few places by setting different attributes:

General pull request blocker comment:

1 2 3 4 { "text": "A task on a pull request." }

Blocker reply to a comment:

1 2 3 4 5 6 7 { "text": "This reply is a task.", "parent": { "id": 1 } }

General blocker file comment:

1 2 3 4 5 6 7 8 9 10 11 { "text": "A blocker comment on a file.", "anchor": { "diffType": "RANGE", "fromHash": "6df3858eeb9a53a911cd17e66a9174d44ffb02cd", "path": "path/to/file", "srcPath": "path/to/file", "toHash": "04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b" } }

Blocker file line comment:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "text": "A task 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" } }

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 backwards compatibility purposes if no diffType is provided and no fromHash/toHash pair is provided the diffType will be resolved to 'EFFECTIVE'. In any other cases the diffType is REQUIRED.

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 diff

If the current user is not a participant the user is added as a watcher of the pull request.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The comment to add.

version

integer

severity

string

id

integer

state

string

text

string

properties

object

Responses

The newly created comment.

application/json

RestComment
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments
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}/pull-requests/{pullRequestId}/blocker-comments' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "properties": {} }'
201Response
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 { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "parent": { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }, "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} blocker-comments {commentId}

Retrieves a pull request comment.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
commentId

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

The requested comment.

application/json

RestComment
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}' \ --header 'Accept: application/json'
200Response
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 { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "parent": { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }, "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }
PUT

Put api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} blocker-comments {commentId}

Update a comment, with the following restrictions:

  • only the author of the comment may update the text of the comment
  • only the author of the comment, the author of the pull request or repository admins and above may update the other fields of a comment

Convert a comment to a task or vice versa.

Comments can be converted to tasks by setting the 'severity' attribute to 'BLOCKER':

1 2 3 4 5 { "severity": "BLOCKER" }

Tasks can be converted to comments by setting the 'severity' attribute to 'NORMAL': ```

{ "severity": "NORMAL" }

1 2 3 4 5 6 7 8 Resolve a blocker comment. Blocker comments can be resolved by setting the 'state' attribute to 'RESOLVED': ``` { "state": "RESOLVED" }

Note: the 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 this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
commentId

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The comment to add.

version

integer

severity

string

id

integer

state

string

text

string

properties

object

Responses

The newly updated comment.

application/json

RestComment
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}
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}/pull-requests/{pullRequestId}/blocker-comments/{commentId}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "properties": {} }'
200Response
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 { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "parent": { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }, "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }
DEL

Delete api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} blocker-comments {commentId}

Delete a pull request comment. Anyone can delete their own comment. Only users with REPO_ADMIN and above may delete comments created by other users.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
commentId

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

version

string

Responses

The operation was successful.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}'
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} changes

Gets changes for the specified PullRequest.

If the changeScope query parameter is set to 'UNREVIEWED', the application will attempt to stream unreviewed changes based on the lastReviewedCommit of the current user, which are the changes between the lastReviewedCommit and the latest commit of the source branch. The current user is considered to not have any unreviewed changes for the pull request when the lastReviewedCommit is either null (everything is unreviewed, so all changes are streamed), equal to the latest commit of the source branch (everything is reviewed), or no longer on the source branch (the source branch has been rebased). In these cases, the application will fall back to streaming all changes (the default), which is the effective diff for the pull request. The type of changes streamed can be determined by the changeScope parameter included in the properties map of the response.

Note: This resource is currently not paged. The server will return at most one page. The server will truncate the number of changes to either the request's page limit or an internal maximum, whichever is smaller. The start parameter of the page request is also ignored.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

sinceId

string

changeScope

string

untilId

string

withComments

string

start

number

limit

number

Responses

A page of unreviewed Changes for the current user from the supplied pull request, including the unreviewedCommits in the properties map.

application/json

RestChange
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/changes
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/changes' \ --header 'Accept: application/json'
200Response
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 { "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "conflict": { "ourChange": { "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "type": "ADD", "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] } }, "theirChange": { "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "type": "ADD", "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] } } }, "contentId": "abcdef0123abcdef4567abcdef8987abcdef6543", "fromContentId": "bcdef0123abcdef4567abcdef8987abcdef6543a", "percentUnchanged": 98, "srcExecutable": true, "type": "ADD", "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "nodeType": "DIRECTORY", "executable": true }
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} comments

Gets comments for the specified pull request and path.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

path

string

fromHash

string

anchorState

string

diffType

array<string>

toHash

string

state

array<string>

diffTypes

string

states

string

start

number

limit

number

Responses

A page of Comments from the supplied pull request.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "parent": { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }, "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} comments

Add a new comment.

Comments can be added in a few places by setting different attributes:

General pull request comment:

 { 
   "text": "An insightful general comment on a pull request." 
 } 
 
Reply to a comment:
 { 

"text": "A measured reply.", "parent": { "id": 1 } }

General file comment:
 {
"text": "An insightful general comment on a file.",
"anchor": {
"diffType": "RANGE",
"fromHash": "6df3858eeb9a53a911cd17e66a9174d44ffb02cd",
"path": "path/to/file",
"srcPath": "path/to/file",
"toHash": "04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b"
}
}
File line comment:
 {
"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"
}
}

Add a new task.

Tasks are just comments with the attribute 'severity' set to 'BLOCKER':

General pull request task:

 {
"text": "A task on a pull request.",
"severity": "BLOCKER"
}

Add a pending comment.

Pending comments are just comments with the attribute 'state' set to 'PENDING':

Pending comment:

 {
"text": "This is a pending comment",
"state": "PENDING"
}

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 backwards compatibility purposes if no diffType is provided and no fromHash/toHash pair is provided the diffType will be resolved to 'EFFECTIVE'. In any other cases the diffType is REQUIRED.

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 diff
If the current user is not a participant the user is added as a watcher of the pull request.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The comment to add

version

integer

severity

string

id

integer

state

string

text

string

properties

object

Responses

The newly created comment.

application/json

RestComment
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments
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}/pull-requests/{pullRequestId}/comments' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "properties": {} }'
201Response
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 { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "parent": { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }, "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} comments {commentId}

Retrieves a pull request comment.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
commentId

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

The requested comment.

application/json

RestComment
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}' \ --header 'Accept: application/json'
200Response
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 { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "parent": { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }, "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }
PUT

Put api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} comments {commentId}

Update a comment, with the following restrictions:

  • only the author of the comment may update the text of the comment
  • only the author of the comment, the author of the pull request or repository admins and above may update the other fields of a comment

Convert a comment to a task or vice versa.

Comments can be converted to tasks by setting the 'severity' attribute to 'BLOCKER':

 { 
 "severity": "BLOCKER" 
 } 
 

Tasks can be converted to comments by setting the 'severity' attribute to 'NORMAL':

 {
"severity": "NORMAL"
}

Resolve a task.

Tasks can be resolved by setting the 'state' attribute to 'RESOLVED':

 {
"state": "RESOLVED"
}

Note: the 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 this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
commentId

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The updated comment

version

integer

severity

string

id

integer

state

string

text

string

properties

object

Responses

The newly updated comment.

application/json

RestComment
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}
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}/pull-requests/{pullRequestId}/comments/{commentId}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "properties": {} }'
200Response
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 { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "parent": { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }, "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }
DEL

Delete api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} comments {commentId}

Delete a pull request comment. Anyone can delete their own comment. Only users with REPO_ADMIN and above may delete comments created by other users.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
commentId

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

version

string

Responses

The operation was successful.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}'
POST

Post api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} comments {commentId} apply-suggestion

Apply a suggestion contained within a comment.

Request

Path parameters

projectKey

string

Required
commentId

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

A request containing other parameters required to apply a suggestion - The given versions/hashes must match the server's version/hashes or the suggestion application will fail (in order to avoid applying the suggestion to the wrong place

commentVersion

object

commitMessage

string

pullRequestVersion

object

suggestionIndex

object

Responses

An empty response indicating the suggestion has been applied.

POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}/apply-suggestion
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}/apply-suggestion' \ --header 'Content-Type: application/json' \ --data '{ "commentVersion": { "asInt": 2154, "present": true }, "commitMessage": "A commit message", "pullRequestVersion": { "asInt": 2154, "present": true }, "suggestionIndex": { "asInt": 2154, "present": true } }'
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} commits

Retrieve commits for the specified pull request.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

avatarScheme

string

withCounts

string

avatarSize

string

start

number

limit

number

Responses

A page of commits from the supplied pull request.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commits
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commits' \ --header 'Accept: application/json'
200Response
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": [ { "committer": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "authorTimestamp": 1359075920, "committerTimestamp": 1449075830, "author": { "emailAddress": "charlie@example.com", "name": "Charlie" }, "message": "More work on feature 1", "parents": [ { "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } ], "displayId": "abcdef0", "id": "abcdef0123abcdef4567abcdef8987abcdef6543" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} decline

Decline a pull request.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

version

string

Request bodyapplication/json

The body holder

comment

string

version

integer

Responses

The pull request was declined.

application/json

RestPullRequest
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/decline
1 2 3 4 5 6 7 8 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/decline' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "comment": "An optional comment explaining why the pull request is being declined", "version": 2154 }'
200Response
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 { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} diff

Streams the raw diff for a pull request.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

contextLines

string

sinceId

string

srcPath

string

untilId

string

whitespace

string

Responses

A raw diff for the specified pull request.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff' \ --header 'Accept: application/json'
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} diff {path}

Streams the raw diff for a pull request.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

path

string

Required
projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

contextLines

string

sinceId

string

srcPath

string

untilId

string

whitespace

string

start

number

limit

number

Responses

A raw diff for the specified pull request.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff/{path}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff/{path}' \ --header 'Accept: application/json'
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} merge

Test whether a pull request can be merged.

A pull request may not be merged if:

  • there are conflicts that need to be manually resolved before merging; and/or
  • one or more merge checks have vetoed the merge.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

The mergeability status of the pull request.

application/json

RestPullRequestMergeability
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 { "outcome": "CLEAN", "vetoes": [ { "detailedMessage": "You have insufficient permissions to rebase 'refs/heads/feature-branch'.", "summaryMessage": "Insufficient branch permissions" } ], "conflicted": true }
POST

Post api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} merge

Merge the specified pull request.

The authenticated user must have REPO_WRITE permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

version

string

Request bodyapplication/json

The body holder

autoSubject

string

context

object

message

string

strategyId

string

version

integer

Responses

The merged pull request.

application/json

RestPullRequest
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge
1 2 3 4 5 6 7 8 9 10 11 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "autoSubject": "(Optional, 5.7+) true to prepend an auto-generated subject to the message (default), or false to use the message as-is", "context": {}, "message": "(Optional) A descriptive message for the merge commit", "strategyId": "(Optional) squash", "version": 2154 }'
200Response
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 { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} participants

Retrieves a page of the participants for a given pull request.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

start

number

limit

number

Responses

Details of the participants in this pull request.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants' \ --header 'Accept: application/json'
201Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 { "values": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} participants

Assigns a participant to an explicit role in pull request. Currently only the REVIEWER role may be assigned.

If the user is not yet a participant in the pull request, they are made one and assigned the supplied role.

If the user is already a participant in the pull request, their previous role is replaced with the supplied role unless they are already assigned the AUTHOR role which cannot be changed and will result in a Bad Request (400) response code.

The authenticated user must have REPO_WRITE permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

lastReviewedCommit

string

approved

boolean

user

object

status

string

role

string

Responses

Details of the participants in this pull request.

application/json

RestPullRequestParticipant
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants
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}/pull-requests/{pullRequestId}/participants' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "type": "NORMAL", "active": true, "links": {}, "avatarUrl": "<string>" }, "status": "UNAPPROVED", "role": "AUTHOR" }'
201Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" }
DEL

Delete api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} participantsDeprecated

Unassigns a participant from the REVIEWER role they may have been given in a pull request.

If the participant has no explicit role this method has no effect.

Afterwards, the user will still remain a participant in the pull request but their role will be reduced to PARTICIPANT. This is because once made a participant of a pull request, a user will forever remain a participant. Only their role may be altered.

The authenticated user must have REPO_WRITE permission for the repository that this pull request targets to call this resource.

Deprecated since 4.2. Use /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug} instead.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

username

string

Responses

The update completed.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants'
PUT

Put api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} participants {userSlug}

Change the current user's status for a pull request. Implicitly adds the user as a participant if they are not already. If the current user is the author, this method will fail.

The possible values for {@code status} are UNAPPROVED, NEEDS_WORK, or APPROVED.

If the new {@code status} is NEEDS_WORK or APPROVED then the {@code lastReviewedCommit} for the participant will be updated to the latest commit of the source branch of the pull request.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
userSlug

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The participant representing the status to set, all fields except status are ignored

lastReviewedCommit

string

approved

boolean

user

object

status

string

role

string

Responses

Details of the new participant.

application/json

RestPullRequestParticipant
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug}
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}/pull-requests/{pullRequestId}/participants/{userSlug}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "type": "NORMAL", "active": true, "links": {}, "avatarUrl": "<string>" }, "status": "UNAPPROVED", "role": "AUTHOR" }'
201Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" }
DEL

Delete api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} participants {userSlug}

Unassigns a participant from the REVIEWER role they may have been given in a pull request.

If the participant has no explicit role this method has no effect.

Afterwards, the user will still remain a participant in the pull request but their role will be reduced to PARTICIPANT. This is because once made a participant of a pull request, a user will forever remain a participant. Only their role may be altered.

The authenticated user must have REPO_WRITE permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
userSlug

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

The update completed.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug}'
POST

Post api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} reopen

Re-open a declined pull request.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

version

string

Request bodyapplication/json

The body holder

version

integer

Responses

The merged pull request.

application/json

RestPullRequest
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reopen
1 2 3 4 5 6 7 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reopen' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "version": 2154 }'
200Response
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 { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} review

Get the CommentThread threads which have Comment comments that have a CommentState#PENDING pending state and are part of the pull request review for the authenticated user.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Query parameters

start

number

limit

number

Responses

A page of Comments from the supplied pull request.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "parent": { "reply": true, "pending": true, "anchored": true, "html": "<string>", "anchor": { "diffType": "COMMIT", "lineComment": true, "fileType": "FROM", "lineType": "ADDED", "fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93", "srcPath": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab", "pullRequest": { "fromRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "toRef": { "displayId": "feature-ABC-1233", "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "participants": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "reviewers": [ { "lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998", "approved": true, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "status": "UNAPPROVED", "role": "AUTHOR" } ], "closedDate": 19990759200, "createdDate": 13590759200, "updatedDate": 14490759200, "version": 2154, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "closed": true, "title": "Talking Nerdy" }, "path": { "extension": "txt", "name": "file.txt", "parent": "path/to", "components": [ "path", "to", "file.txt" ] }, "line": 98 }, "createdDate": 1359075920, "author": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "updatedDate": 1449075920, "version": 1, "severity": "NORMAL", "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} }, "id": 1, "state": "OPEN", "text": "An insightful comment.", "comments": [], "properties": {} } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
PUT

Put api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} review

Complete a review on a pull request.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The REST request which contains comment text and participant status

commentText

string

participantStatus

string

Responses

Getting back the number of published comments and completing the review on a pull request.

application/json

any

PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review
1 2 3 4 5 6 7 8 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "commentText": "General comment text", "participantStatus": "approved" }'
DEL

Delete api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} review

Discard a pull request review for the authenticated user.

The authenticated user must have REPO_READ permission for the repository to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

The pull request review has been discarded.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review'
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} tasksDeprecated

Retrieve the tasks associated with a pull request.

Removed in 8.0. Tasks are now managed using Comments with BLOCKER severity. Use /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments instead

Deprecated since 7.2, changed to 404 in 8.0, remove in 9.0. Use /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments instead

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

This endpoint has been removed as tasks are now managed using Comments with severity BLOCKER.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/tasks
1 2 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/tasks'
404Response
1 2 3 4 5 6 7 8 9 { "errors": [ { "exceptionName": "<string>", "message": "<string>", "context": "<string>" } ] }
GET

Get api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} tasks countDeprecated

Retrieve the total number of OPEN and RESOLVED tasks associated with a pull request.

Deprecated since 7.2. Tasks are now managed using Comments with BLOCKER severity. Use /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments?count=true instead.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

This endpoint has been removed as tasks are now managed using Comments with severity BLOCKER.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/tasks/count
1 2 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/tasks/count'
404Response
1 2 3 4 5 6 7 8 9 { "errors": [ { "exceptionName": "<string>", "message": "<string>", "context": "<string>" } ] }
POST

Post api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} watch

Add the authenticated user as a watcher for the specified pull request.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

The user is now watching the pull request.

POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch
1 2 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch'
DEL

Delete api latest projects {projectKey} repos {repositorySlug} pull-requests {pullRequestId} watch

Remove the authenticated user as a watcher for the specified pull request.

The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.

Request

Path parameters

projectKey

string

Required
pullRequestId

string

Required
repositorySlug

string

Required

Responses

The user is no longer watching the pull request.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch'
GET

Get api latest projects {projectKey} repos {repositorySlug} raw

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Responses

The raw contents from a file.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/raw
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/raw' \ --header 'Accept: application/json'
GET

Get api latest projects {projectKey} repos {repositorySlug} raw {path}

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.

Request

Path parameters

path

string

Required
projectKey

string

Required
repositorySlug

string

Required

Query parameters

at

string

markup

string

htmlEscape

string

includeHeadingId

string

hardwrap

string

Responses

The raw contents from a file.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/raw/{path}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/raw/{path}' \ --header 'Accept: application/json'
GET

Get api latest projects {projectKey} repos {repositorySlug} readme

Retrieves the README for the repository, if it's been defined.

This checks the repository for a

README
file, optionally with an
md
or
txt
extension, and, if found, streams it. By default, the raw content of the file is streamed. Appending
?markup
to the URL will stream an HTML-rendered version instead. Note that, when streaming HTML, relative URLs in the README will not work if applied relative to this URL.

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

at

string

markup

string

htmlEscape

string

includeHeadingId

string

hardwrap

string

Responses

The README for the repository.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/readme
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/readme' \ --header 'Accept: application/json'
HEAD

Head api latest projects {projectKey} repos {repositorySlug} readme

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Responses

default response

application/json;charset=UTF-8

any

HEAD/api/latest/projects/{projectKey}/repos/{repositorySlug}/readme
1 2 curl --request HEAD \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/readme'
POST

Post api latest projects {projectKey} repos {repositorySlug} recreate

If a create or fork operation fails, calling this method will clean up the broken repository and try again. The repository must be in an INITIALISATION_FAILED state.

The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Responses

The newly created repository.

application/json

RestRepository
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/recreate
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/recreate' \ --header 'Accept: application/json'
201Response
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 { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }
GET

Get api latest projects {projectKey} repos {repositorySlug} ref-change-activities

Retrieve a page of repository ref change activity.

The authenticated user must have REPO_ADMIN permission to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

ref

string

start

number

limit

number

Responses

A page of ref change activity.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/ref-change-activities
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/ref-change-activities' \ --header 'Accept: application/json'
200Response
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 { "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": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "user": { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }, "createdDate": 19990759200, "id": 1 } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} repos {repositorySlug} ref-change-activities branches

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

filterText

string

start

number

limit

number

Responses

A page of branches with ref change activities.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/ref-change-activities/branches
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/ref-change-activities/branches' \ --header 'Accept: application/json'
200Response
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 }
GET

Retrieve repositories which are related to this one. Related repositories are from the same Repository#getHierarchyId() hierarchy as this repository.

Only repositories to which the authenticated user has REPO_READ permission will be included, even if more repositories are part of this repository's hierarchy.

projectKey

string

Required
repositorySlug

string

Required
start

number

limit

number

A page of repositories related to the request repository.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/related
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/related' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} repos {repositorySlug} settings auto-decline

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Responses

The auto decline settings

application/json

RestAutoDeclineSettings
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-decline
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-decline' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 { "inactivityWeeks": 4, "scope": { "resourceId": 2, "type": "GLOBAL" }, "enabled": true }
PUT

Put api latest projects {projectKey} repos {repositorySlug} settings auto-decline

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

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The settings to create or update

enabled

boolean

inactivityWeeks

integer

Responses

The auto decline settings

application/json

RestAutoDeclineSettings
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-decline
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 }'
200Response
1 2 3 4 5 6 7 8 { "inactivityWeeks": 4, "scope": { "resourceId": 2, "type": "GLOBAL" }, "enabled": true }
DEL

Delete api latest projects {projectKey} repos {repositorySlug} settings auto-decline

Delete auto decline settings for the supplied repository.

The authenticated user must have REPO_ADMIN permission for this repository to call the resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Responses

The auto decline settings have been deleted successfully.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-decline
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-decline'
GET

Get api latest projects {projectKey} repos {repositorySlug} settings hooks

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

type

string

start

number

limit

number

Responses

A page of repository hooks with their associated enabled state.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks' \ --header 'Accept: application/json'
200Response
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": [ { "details": { "configFormKey": "<string>", "supportedScopes": [ "GLOBAL" ], "version": "<string>", "name": "<string>", "key": "<string>", "type": "PRE_RECEIVE", "description": "<string>" }, "configured": true, "enabled": true, "scope": { "resourceId": 2, "type": "GLOBAL" } } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} repos {repositorySlug} settings hooks {hookKey}

Retrieve a repository hook for this repository.

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
hookKey

string

Required
repositorySlug

string

Required

Responses

The repository hooks with their associated enabled state for the supplied hookKey.

application/json

RestRepositoryHook
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 { "details": { "configFormKey": "<string>", "supportedScopes": [ "GLOBAL" ], "version": "<string>", "name": "<string>", "key": "<string>", "type": "PRE_RECEIVE", "description": "<string>" }, "configured": true, "enabled": true, "scope": { "resourceId": 2, "type": "GLOBAL" } }
DEL

Delete api latest projects {projectKey} repos {repositorySlug} settings hooks {hookKey}

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.

Request

Path parameters

projectKey

string

Required
hookKey

string

Required
repositorySlug

string

Required

Responses

The hook configuration matching the supplied hookKey and repositorySlug was deleted

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}'
PUT

Put api latest projects {projectKey} repos {repositorySlug} settings hooks {hookKey} enabled

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.

Request

Path parameters

projectKey

string

Required
hookKey

string

Required
repositorySlug

string

Required

Header parameters

Content-Length

string

Responses

The repository hooks with their associated enabled state for the supplied hookKey.

application/json

RestRepositoryHook
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/enabled
1 2 3 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/enabled' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 { "details": { "configFormKey": "<string>", "supportedScopes": [ "GLOBAL" ], "version": "<string>", "name": "<string>", "key": "<string>", "type": "PRE_RECEIVE", "description": "<string>" }, "configured": true, "enabled": true, "scope": { "resourceId": 2, "type": "GLOBAL" } }
DEL

Delete api latest projects {projectKey} repos {repositorySlug} settings hooks {hookKey} enabled

Disable a repository hook for this repository.

The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
hookKey

string

Required
repositorySlug

string

Required

Responses

The repository hooks with their associated enabled state for the supplied hookKey.

application/json

RestRepositoryHook
DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/enabled
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/enabled' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 { "details": { "configFormKey": "<string>", "supportedScopes": [ "GLOBAL" ], "version": "<string>", "name": "<string>", "key": "<string>", "type": "PRE_RECEIVE", "description": "<string>" }, "configured": true, "enabled": true, "scope": { "resourceId": 2, "type": "GLOBAL" } }
GET

Get api latest projects {projectKey} repos {repositorySlug} settings hooks {hookKey} settings

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.

Request

Path parameters

projectKey

string

Required
hookKey

string

Required
repositorySlug

string

Required

Responses

The settings for the hook.

application/json

ExampleSettings
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/settings
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/settings' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 { "stringValue": "This is an arbitrary string", "booleanValue": true, "doubleValue": 1.1, "integerValue": 1, "longValue": -2147483648 }
PUT

Put api latest projects {projectKey} repos {repositorySlug} settings hooks {hookKey} settings

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.

Request

Path parameters

projectKey

string

Required
hookKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The raw settings.

stringValue

string

booleanValue

boolean

doubleValue

number

integerValue

integer

longValue

integer

Responses

The settings for the hook.

application/json

ExampleSettings
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/settings
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 '{ "stringValue": "This is an arbitrary string", "booleanValue": true, "doubleValue": 1.1, "integerValue": 1, "longValue": -2147483648 }'
200Response
1 2 3 4 5 6 7 { "stringValue": "This is an arbitrary string", "booleanValue": true, "doubleValue": 1.1, "integerValue": 1, "longValue": -2147483648 }
GET

Get api latest projects {projectKey} repos {repositorySlug} settings pull-requests

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

  • mergeConfig - the merge strategy configuration for pull requests
  • requiredApprovers - (Deprecated, please use com.atlassian.bitbucket.server.bundled-hooks.requiredApproversMergeHook instead) the number of approvals required on a pull request for it to be mergeable, or 0 if the merge check is disabled
  • com.atlassian.bitbucket.server.bundled-hooks.requiredApproversMergeHook - the merge check configuration for required approvers
  • requiredAllApprovers - whether or not all approvers must approve a pull request for it to be mergeable
  • requiredAllTasksComplete - whether or not all tasks on a pull request need to be completed for it to be mergeable
  • requiredSuccessfulBuilds - (Deprecated, please use com.atlassian.bitbucket.server.bitbucket-build.requiredBuildsMergeCheck instead) the number of successful builds on a pull request for it to be mergeable, or 0 if the merge check is disabled
  • com.atlassian.bitbucket.server.bitbucket-build.requiredBuildsMergeCheck - the merge check configuration for required builds

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Responses

The repository pull request settings for the context repository.

application/json

RestRepositoryPullRequestSettings
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requests
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requests' \ --header 'Accept: application/json'
200Response
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 { "mergeConfig": { "strategies": [ { "flag": "--no-ff", "name": "Merge commit", "id": "no-ff", "enabled": true, "description": "Always create a merge commit" } ], "commitSummaries": 2154, "defaultStrategy": { "flag": "--no-ff", "name": "Merge commit", "id": "no-ff", "enabled": true, "description": "Always create a merge commit" }, "type": "repository" }, "requiredAllApprovers": true, "requiredApproversDeprecated": 2154, "requiredSuccessfulBuilds": { "count": "3", "enabled": true }, "requiredSuccessfulBuildsDeprecated": 2154, "requiredAllTasksComplete": true, "requiredApprovers": { "count": "3", "enabled": true } }
POST

Post api latest projects {projectKey} repos {repositorySlug} settings pull-requests

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

  • mergeConfig - the merge strategy configuration for pull requests
  • requiredApprovers - (Deprecated, please use com.atlassian.bitbucket.server.bundled-hooks.requiredApproversMergeHook instead) the number of approvals required on a pull request for it to be mergeable, or 0 to disable the merge check
  • com.atlassian.bitbucket.server.bundled-hooks.requiredApproversMergeHook - a json map containing the keys 'enabled' (a boolean to enable or disable this merge check) and 'count' (an integer to set the number of required approvals)
  • requiredAllApprovers - whether or not all approvers must approve a pull request for it to be mergeable
  • requiredAllTasksComplete - whether or not all tasks on a pull request need to be completed for it to be mergeable
  • requiredSuccessfulBuilds - (Deprecated, please use com.atlassian.bitbucket.server.bitbucket-build.requiredBuildsMergeCheck instead) the number of successful builds on a pull request for it to be mergeable, or 0 to disable the merge check
  • com.atlassian.bitbucket.server.bitbucket-build.requiredBuildsMergeCheck - a json map containing the keys 'enabled' (a boolean to enable or disable this merge check) and 'count' (an integer to set the number of required builds)

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:

  • The configuration set for this repository's SCM type as set at the project level, if present, otherwise
  • the configuration set for this repository's SCM type as set at the instance level, if present, otherwise
  • the default configuration for this repository's SCM type

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The updated settings.

mergeConfig

object

requiredAllApprovers

boolean

requiredApproversDeprecated

integer

requiredSuccessfulBuilds

object

requiredSuccessfulBuildsDeprecated

integer

requiredAllTasksComplete

boolean

requiredApprovers

object

Responses

The repository pull request settings for the context repository.

application/json

RestRepositoryPullRequestSettings
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requests
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 '{ "mergeConfig": { "strategies": [ { "id": "no-ff", "links": {} } ], "commitSummaries": 2154, "defaultStrategy": { "id": "no-ff", "links": {} } }, "requiredAllApprovers": true, "requiredApproversDeprecated": 2154, "requiredSuccessfulBuilds": { "count": "3", "enabled": true }, "requiredSuccessfulBuildsDeprecated": 2154, "requiredAllTasksComplete": true, "requiredApprovers": { "count": "3", "enabled": true } }'
200Response
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 { "mergeConfig": { "strategies": [ { "flag": "--no-ff", "name": "Merge commit", "id": "no-ff", "enabled": true, "description": "Always create a merge commit" } ], "commitSummaries": 2154, "defaultStrategy": { "flag": "--no-ff", "name": "Merge commit", "id": "no-ff", "enabled": true, "description": "Always create a merge commit" }, "type": "repository" }, "requiredAllApprovers": true, "requiredApproversDeprecated": 2154, "requiredSuccessfulBuilds": { "count": "3", "enabled": true }, "requiredSuccessfulBuildsDeprecated": 2154, "requiredAllTasksComplete": true, "requiredApprovers": { "count": "3", "enabled": true } }
GET

Get api latest projects {projectKey} repos {repositorySlug} settings reviewer-groups

Retrieve a page of reviewer groups of a given scope.

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

start

number

limit

number

Responses

A page of reviewer group(s) of the provided scope and its inherited scope.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "name": "name", "id": 2154, "description": "null", "scope": { "resourceId": 2, "type": "GLOBAL" } } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest projects {projectKey} repos {repositorySlug} settings reviewer-groups

Create a reviewer group.

The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The request containing the details of the reviewer group.

avatarUrl

string

users

array<ApplicationUser>

name

string

id

integer

description

string

scope

object

Responses

The newly created reviewer group.

application/json

RestReviewerGroup
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups
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 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "avatarUrl": "<string>", "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "name": "name", "id": 2154, "description": "null", "scope": { "resourceId": 2, "type": "GLOBAL" } }'
201Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "name": "name", "id": 2154, "description": "null", "scope": { "resourceId": 2, "type": "GLOBAL" } }
GET

Get api latest projects {projectKey} repos {repositorySlug} settings reviewer-groups {id}

Retrieve a reviewer group.

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required
repositorySlug

string

Required

Responses

The reviewer group.

application/json

RestReviewerGroup
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "name": "name", "id": 2154, "description": "null", "scope": { "resourceId": 2, "type": "GLOBAL" } }
PUT

Put api latest projects {projectKey} repos {repositorySlug} settings reviewer-groups {id}

Update the attributes of a reviewer group.

The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The request containing the attributes of the reviewer group to be updated. Only the attributes to be updated need to be present in this object.

avatarUrl

string

users

array<ApplicationUser>

name

string

id

integer

description

string

scope

object

Responses

The updated reviewer group.

application/json

RestReviewerGroup
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}
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 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "avatarUrl": "<string>", "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "name": "name", "id": 2154, "description": "null", "scope": { "resourceId": 2, "type": "GLOBAL" } }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "name": "name", "id": 2154, "description": "null", "scope": { "resourceId": 2, "type": "GLOBAL" } }
DEL

Delete api latest projects {projectKey} repos {repositorySlug} settings reviewer-groups {id}

Deletes a reviewer group.

The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required
repositorySlug

string

Required

Responses

The operation was successful

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}'
GET

Get api latest projects {projectKey} repos {repositorySlug} settings reviewer-groups {id} users

Retrieve a list of the users of a reviewer group.

This does not return all the users of the group, only the users who have REPO_READ permission for the specified repository.

The authenticated user must have REPO_READ permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required
repositorySlug

string

Required

Responses

The list of users of a reviewer group.

application/json;charset=UTF-8

array<RestApplicationUser>

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}/users
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}/users' \ --header 'Accept: application/json;charset=UTF-8'
GET

Get api latest projects {projectKey} repos {repositorySlug} tags

Retrieve the tags matching the supplied filterText param.

The authenticated user must have REPO_READ permission for the context repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

orderBy

string

filterText

string

start

number

limit

number

Responses

The tags matching the supplied filterText.

application/json

object
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/tags
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/tags' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 { "values": [ { "hash": "8d51122def5632836d1cb1026e879069e10a1e13", "latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13", "latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13", "displayId": "master", "id": "refs/heads/master", "type": "BRANCH" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest projects {projectKey} repos {repositorySlug} tags

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The request to create a tag containing a name, startPoint, and optionally a message

message

string

name

string

startPoint

string

Responses

The created tag.

application/json

RestTag
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/tags
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" }'
200Response
1 2 3 4 5 6 7 8 { "hash": "8d51122def5632836d1cb1026e879069e10a1e13", "latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13", "latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13", "displayId": "master", "id": "refs/heads/master", "type": "BRANCH" }
GET

Get api latest projects {projectKey} repos {repositorySlug} tags {name}

Retrieve a tag in the specified repository.

The authenticated user must have REPO_READ permission for the context repository to call this resource.

Request

Path parameters

projectKey

string

Required
name

string

Required
repositorySlug

string

Required

Responses

The tag which matches the supplied name.

application/json

RestTag
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/tags/{name}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/tags/{name}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 { "hash": "8d51122def5632836d1cb1026e879069e10a1e13", "latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13", "latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13", "displayId": "master", "id": "refs/heads/master", "type": "BRANCH" }
POST

Post api latest projects {projectKey} repos {repositorySlug} watch

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The repository to watch.

scmId

string

slug

string

name

string

project

string

links

object

Responses

The user is now watching the repository.

POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/watch
1 2 3 4 5 6 7 8 9 10 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/watch' \ --header 'Content-Type: application/json' \ --data '{ "scmId": "git", "slug": "my-repo", "name": "My repo", "project": "PROJ", "links": {} }'
DEL

Delete api latest projects {projectKey} repos {repositorySlug} watch

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Responses

The user is no longer watching the repository.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/watch
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/watch'
GET

Get api latest projects {projectKey} repos {repositorySlug} webhooks

Find webhooks in this repository.

The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

event

string

statistics

boolean

Responses

A page of webhooks.

application/json

any

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks' \ --header 'Accept: application/json'
POST

Post api latest projects {projectKey} repos {repositorySlug} webhooks

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.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The webhook to be created for this repository.

events

array<string>

active

boolean

statistics

object

name

string

configuration

object

url

string

Responses

A created webhook.

application/json

RestWebhook
POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks
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": {}, "name": "<string>", "configuration": {}, "url": "<string>" }'
200Response
1 2 3 4 5 6 7 8 9 { "events": [ "<string>" ], "active": true, "name": "<string>", "configuration": {}, "url": "<string>" }
POST

Post api latest projects {projectKey} repos {repositorySlug} webhooks test

Find webhooks in this repository.

The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

url

string

Responses

A webhook.

application/json

RestWebhookRequestResponse

POST/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/test
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/test' \ --header 'Accept: application/json'
GET

Get 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.

Request

Path parameters

projectKey

string

Required
webhookId

string

Required
repositorySlug

string

Required

Query parameters

statistics

string

Responses

A webhook.

application/json

RestWebhook
GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 { "events": [ "<string>" ], "active": true, "name": "<string>", "configuration": {}, "url": "<string>" }
PUT

Put 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.

Request

Path parameters

projectKey

string

Required
webhookId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The representation of the updated values for the webhook

events

array<string>

active

boolean

statistics

object

name

string

configuration

object

url

string

Responses

A webhook.

application/json

RestWebhook
PUT/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}
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": {}, "name": "<string>", "configuration": {}, "url": "<string>" }'
200Response
1 2 3 4 5 6 7 8 9 { "events": [ "<string>" ], "active": true, "name": "<string>", "configuration": {}, "url": "<string>" }
DEL

Delete api latest projects {projectKey} repos {repositorySlug} webhooks {webhookId}

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.

Request

Path parameters

projectKey

string

Required
webhookId

string

Required
repositorySlug

string

Required

Responses

The webhook for the repository has been deleted.

DEL/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}'
GET

Get api latest projects {projectKey} repos {repositorySlug} webhooks {webhookId} latest

Find webhooks in this repository.

The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
webhookId

string

Required
repositorySlug

string

Required

Query parameters

event

string

outcome

string

Responses

A webhook invocation dataset.

application/json

RestDetailedInvocation

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/latest
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/latest' \ --header 'Accept: application/json'
GET

Get api latest projects {projectKey} repos {repositorySlug} webhooks {webhookId} statistics

Find webhooks in this repository.

The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
webhookId

string

Required
repositorySlug

string

Required

Query parameters

event

string

Responses

A webhook invocation dataset.

application/json

RestInvocationHistory

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/statistics
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/statistics' \ --header 'Accept: application/json'
GET

Get api latest projects {projectKey} repos {repositorySlug} webhooks {webhookId} statistics summary

Find webhooks in this repository.

The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.

Request

Path parameters

projectKey

string

Required
webhookId

string

Required
repositorySlug

string

Required

Responses

A webhook invocation dataset.

application/json

RestInvocationHistory

GET/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/statistics/summary
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/statistics/summary' \ --header 'Accept: application/json'
GET

Get api latest projects {projectKey} settings auto-decline

Retrieves the auto decline settings for the supplied project. Default settings are returned if no explicit settings have been set for the project.

Request

Path parameters

projectKey

string

Required

Responses

The auto decline settings

application/json

RestAutoDeclineSettings
GET/api/latest/projects/{projectKey}/settings/auto-decline
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/auto-decline' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 { "inactivityWeeks": 4, "scope": { "resourceId": 2, "type": "GLOBAL" }, "enabled": true }
PUT

Put api latest projects {projectKey} settings auto-decline

Creates or updates the auto decline settings for the supplied project.

The authenticated user must have PROJECT_ADMIN permission for this project to call the resource.

Request

Path parameters

projectKey

string

Required

Request bodyapplication/json

The settings to create or update

enabled

boolean

inactivityWeeks

integer

Responses

The auto decline settings

application/json

RestAutoDeclineSettings
PUT/api/latest/projects/{projectKey}/settings/auto-decline
1 2 3 4 5 6 7 8 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/auto-decline' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "enabled": true, "inactivityWeeks": 4 }'
200Response
1 2 3 4 5 6 7 8 { "inactivityWeeks": 4, "scope": { "resourceId": 2, "type": "GLOBAL" }, "enabled": true }
DEL

Delete api latest projects {projectKey} settings auto-decline

Delete auto decline settings for the supplied project.

The authenticated user must have PROJECT_ADMIN permission for this project to call the resource.

Request

Path parameters

projectKey

string

Required

Responses

The auto decline settings have been deleted successfully.

DEL/api/latest/projects/{projectKey}/settings/auto-decline
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/auto-decline'
GET

Get api latest projects {projectKey} settings hooks

Retrieve a page of repository hooks for this project.

The authenticated user must have PROJECT_READ permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required

Query parameters

type

string

start

number

limit

number

Responses

A page of repository hooks with their associated enabled state.

application/json

object
GET/api/latest/projects/{projectKey}/settings/hooks
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/hooks' \ --header 'Accept: application/json'
200Response
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": [ { "details": { "configFormKey": "<string>", "supportedScopes": [ "GLOBAL" ], "version": "<string>", "name": "<string>", "key": "<string>", "type": "PRE_RECEIVE", "description": "<string>" }, "configured": true, "enabled": true, "scope": { "resourceId": 2, "type": "GLOBAL" } } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
GET

Get api latest projects {projectKey} settings hooks {hookKey}

Retrieve a repository hook for this project.

The authenticated user must have PROJECT_READ permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required
hookKey

string

Required

Responses

Returns the repository hooks with their associated enabled state for the supplied hookKey.

application/json

RestRepositoryHook
GET/api/latest/projects/{projectKey}/settings/hooks/{hookKey}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/hooks/{hookKey}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 { "details": { "configFormKey": "<string>", "supportedScopes": [ "GLOBAL" ], "version": "<string>", "name": "<string>", "key": "<string>", "type": "PRE_RECEIVE", "description": "<string>" }, "configured": true, "enabled": true, "scope": { "resourceId": 2, "type": "GLOBAL" } }
PUT

Put api latest projects {projectKey} settings hooks {hookKey} enabled

Enable a repository hook for this project and optionally apply new configuration.

The authenticated user must have PROJECT_ADMIN permission for the specified project 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.

Request

Path parameters

projectKey

string

Required
hookKey

string

Required

Header parameters

Content-Length

integer

Responses

The repository hooks with their associated enabled state for the supplied hookKey.

application/json

RestRepositoryHook
PUT/api/latest/projects/{projectKey}/settings/hooks/{hookKey}/enabled
1 2 3 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/hooks/{hookKey}/enabled' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 { "details": { "configFormKey": "<string>", "supportedScopes": [ "GLOBAL" ], "version": "<string>", "name": "<string>", "key": "<string>", "type": "PRE_RECEIVE", "description": "<string>" }, "configured": true, "enabled": true, "scope": { "resourceId": 2, "type": "GLOBAL" } }
DEL

Delete api latest projects {projectKey} settings hooks {hookKey} enabled

Disable a repository hook for this project.

The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required
hookKey

string

Required

Responses

The repository hooks with their associated enabled state for the supplied hookKey.

application/json

RestRepositoryHook
DEL/api/latest/projects/{projectKey}/settings/hooks/{hookKey}/enabled
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/hooks/{hookKey}/enabled' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 { "details": { "configFormKey": "<string>", "supportedScopes": [ "GLOBAL" ], "version": "<string>", "name": "<string>", "key": "<string>", "type": "PRE_RECEIVE", "description": "<string>" }, "configured": true, "enabled": true, "scope": { "resourceId": 2, "type": "GLOBAL" } }
GET

Get api latest projects {projectKey} settings hooks {hookKey} settings

Retrieve the settings for a repository hook for this project.

The authenticated user must have PROJECT_READ permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required
hookKey

string

Required

Responses

The settings for the hook.

application/json

ExampleSettings
GET/api/latest/projects/{projectKey}/settings/hooks/{hookKey}/settings
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/hooks/{hookKey}/settings' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 { "stringValue": "This is an arbitrary string", "booleanValue": true, "doubleValue": 1.1, "integerValue": 1, "longValue": -2147483648 }
PUT

Put api latest projects {projectKey} settings hooks {hookKey} settings

Modify the settings for a repository hook for this project.

The service will reject any settings which are too large, the current limit is 32KB once serialized.

The authenticated user must have PROJECT_ADMIN permission for the specified project 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.

Request

Path parameters

projectKey

string

Required
hookKey

string

Required

Request bodyapplication/json

The raw settings.

stringValue

string

booleanValue

boolean

doubleValue

number

integerValue

integer

longValue

integer

Responses

The settings for the hook.

application/json

ExampleSettings
PUT/api/latest/projects/{projectKey}/settings/hooks/{hookKey}/settings
1 2 3 4 5 6 7 8 9 10 11 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/hooks/{hookKey}/settings' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "stringValue": "This is an arbitrary string", "booleanValue": true, "doubleValue": 1.1, "integerValue": 1, "longValue": -2147483648 }'
200Response
1 2 3 4 5 6 7 { "stringValue": "This is an arbitrary string", "booleanValue": true, "doubleValue": 1.1, "integerValue": 1, "longValue": -2147483648 }
GET

Get api latest projects {projectKey} settings pull-requests {scmId}

Retrieve the merge strategy configuration for this project and SCM.

The authenticated user must have PROJECT_READ permission for the context repository to call this resource.

Request

Path parameters

projectKey

string

Required
scmId

string

Required

Responses

The merge configuration of the request project.

application/json

RestPullRequestSettings
GET/api/latest/projects/{projectKey}/settings/pull-requests/{scmId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/pull-requests/{scmId}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 { "mergeConfig": { "strategies": [ { "flag": "--no-ff", "name": "Merge commit", "id": "no-ff", "enabled": true, "description": "Always create a merge commit" } ], "commitSummaries": 2154, "defaultStrategy": { "flag": "--no-ff", "name": "Merge commit", "id": "no-ff", "enabled": true, "description": "Always create a merge commit" }, "type": "repository" } }
POST

Post api latest projects {projectKey} settings pull-requests {scmId}

Update the pull request merge strategy configuration for this project and SCM.

The authenticated user must have PROJECT_ADMIN permission for the context repository to call this resource.

Only the strategies provided will be enabled, the default must be set and included in the set of strategies.

An explicitly set pull request merge strategy configuration can be deleted by POSTing a document with an empty "mergeConfig" attribute. i.e:

{ 
    "mergeConfig": {} 
} 

Upon completion of this request, the effective configuration will be the configuration explicitly set for the SCM, or if no such explicit configuration is set then the default configuration will be used.

Request

Path parameters

projectKey

string

Required
scmId

string

Required

Request bodyapplication/json

The settings.

mergeConfig

object

Responses

The merge configuration of the request project.

application/json

RestPullRequestSettings
POST/api/latest/projects/{projectKey}/settings/pull-requests/{scmId}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/pull-requests/{scmId}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "mergeConfig": { "strategies": [ { "id": "no-ff", "links": {} } ], "commitSummaries": 2154, "defaultStrategy": { "id": "no-ff", "links": {} } } }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 { "mergeConfig": { "strategies": [ { "flag": "--no-ff", "name": "Merge commit", "id": "no-ff", "enabled": true, "description": "Always create a merge commit" } ], "commitSummaries": 2154, "defaultStrategy": { "flag": "--no-ff", "name": "Merge commit", "id": "no-ff", "enabled": true, "description": "Always create a merge commit" }, "type": "repository" } }
GET

Get api latest projects {projectKey} settings reviewer-groups

Retrieve a page of reviewer groups of a given scope.

The authenticated user must have PROJECT_READ permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required

Query parameters

start

number

limit

number

Responses

A page of reviewer group(s) of the provided scope.

application/json

object
GET/api/latest/projects/{projectKey}/settings/reviewer-groups
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups' \ --header 'Accept: application/json'
200Response
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 { "values": [ { "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "name": "name", "id": 2154, "description": "null", "scope": { "resourceId": 2, "type": "GLOBAL" } } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest projects {projectKey} settings reviewer-groups

Create a reviewer group.

The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required

Request bodyapplication/json

The reviewer group to be create

avatarUrl

string

users

array<ApplicationUser>

name

string

id

integer

description

string

scope

object

Responses

The newly created reviewer group.

application/json

RestReviewerGroup
POST/api/latest/projects/{projectKey}/settings/reviewer-groups
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 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "avatarUrl": "<string>", "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "name": "name", "id": 2154, "description": "null", "scope": { "resourceId": 2, "type": "GLOBAL" } }'
201Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "name": "name", "id": 2154, "description": "null", "scope": { "resourceId": 2, "type": "GLOBAL" } }
GET

Get api latest projects {projectKey} settings reviewer-groups {id}

Retrieve a reviewer group.

The authenticated user must have PROJECT_READ permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required

Responses

The reviewer group.

application/json

RestReviewerGroup
GET/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "name": "name", "id": 2154, "description": "null", "scope": { "resourceId": 2, "type": "GLOBAL" } }
PUT

Put api latest projects {projectKey} settings reviewer-groups {id}

Update the attributes of a reviewer group.

The authenticated user must have PROJECT_READ permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required

Request bodyapplication/json

The request containing the attributes of the reviewer group to be updated. Only the attributes to be updated need to be present in this object.

avatarUrl

string

users

array<ApplicationUser>

name

string

id

integer

description

string

scope

object

Responses

A page of changes.

application/json

RestReviewerGroup
PUT/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}
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 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "avatarUrl": "<string>", "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "name": "name", "id": 2154, "description": "null", "scope": { "resourceId": 2, "type": "GLOBAL" } }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 { "users": [ { "slug": "<string>", "displayName": "<string>", "id": 2154, "type": "NORMAL", "active": true, "emailAddress": "<string>", "name": "<string>" } ], "name": "name", "id": 2154, "description": "null", "scope": { "resourceId": 2, "type": "GLOBAL" } }
DEL

Delete api latest projects {projectKey} settings reviewer-groups {id}

Deletes a reviewer group.

The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required

Responses

The operation was successful.

DEL/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}'
GET

Get api latest repos

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.

Request

Query parameters

archived

string

projectname

string

projectkey

string

visibility

string

name

string

permission

string

state

string

start

number

limit

number

Responses

A page of repositories.

application/json

object
GET/api/latest/repos
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/repos' \ --header 'Accept: application/json'
201Response
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 { "values": [ { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post api latest tasksDeprecated

Create a new task.

Removed in 8.0. Tasks are now managed using Comments with severity BLOCKER. Call POST /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments instead,passing the attribute 'severity' set to 'BLOCKER'.

Request

This request has no parameters.

Responses

This endpoint has been removed as tasks are now managed using Comments with severity BLOCKER.

application/json

object
POST/api/latest/tasks
1 2 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/tasks'
404Response
1 2 3 4 5 6 7 8 9 { "errors": [ { "exceptionName": "<string>", "message": "<string>", "context": "<string>" } ] }
GET

Get api latest tasks {taskId}Deprecated

Retrieve an existing task.

Removed in 8.0. Tasks are now managed using Comments with BLOCKER severity. Call GET /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId} instead. @deprecated since 7.2, changed to 404 in 8.0, remove in 9.0. Call GET /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId} instead.

Request

Path parameters

taskId

string

Required

Responses

This endpoint has been removed as tasks are now managed using Comments with severity BLOCKER.

application/json

object
GET/api/latest/tasks/{taskId}
1 2 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/tasks/{taskId}'
404Response
1 2 3 4 5 6 7 8 9 { "errors": [ { "exceptionName": "<string>", "message": "<string>", "context": "<string>" } ] }
PUT

Put api latest tasks {taskId}Deprecated

Update an existing task.

Removed in 8.0. Tasks are now managed using Comments with BLOCKER severity. Call PUT /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId} instead. To resolve a task, pass the attribute 'state' set to 'RESOLVED'. @deprecated since 7.2, changed to 404 in 8.0, remove in 9.0. Call PUT /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId} instead.

As of Stash 3.3, only the state and text of a task can be updated.

Updating the state of a task is allowed for any user having READ access to the repository. However only the task's creator, the context's author or an admin of the context's repository can update the task's text. (For a pull request task, those are the task's creator, the pull request's author or an admin on the repository containing the pull request). Additionally the task's text cannot be updated if it has been resolved.

Request

Path parameters

taskId

string

Required

Responses

This endpoint has been removed as tasks are now managed using Comments with severity BLOCKER.

application/json

object
PUT/api/latest/tasks/{taskId}
1 2 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/tasks/{taskId}'
404Response
1 2 3 4 5 6 7 8 9 { "errors": [ { "exceptionName": "<string>", "message": "<string>", "context": "<string>" } ] }
DEL

Delete api latest tasks {taskId}Deprecated

Delete a task.

Removed in 8.0. Tasks are now managed using Comments with BLOCKER severity. Call DELETE /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}instead. @deprecated since 7.2, changed to 404 in 8.0, remove in 9.0. Call DELETE /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId} instead.

Note that only the task's creator, the context's author or an admin of the context's repository can delete a task. (For a pull request task, those are the task's creator, the pull request's author or an admin on the repository containing the pull request). Additionally a task cannot be deleted if it has already been resolved.

Request

Path parameters

taskId

string

Required

Responses

This endpoint has been removed as tasks are now managed using Comments with severity BLOCKER.

application/json

object
DEL/api/latest/tasks/{taskId}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/tasks/{taskId}'
404Response
1 2 3 4 5 6 7 8 9 { "errors": [ { "exceptionName": "<string>", "message": "<string>", "context": "<string>" } ] }
GET

Get api latest users

Retrieve a page of users, optionally run through provided filters.

Only authenticated users may call this resource.

Permission Filters

The following three sub-sections list parameters supported for permission filters (where [root] is the root permission filter name, e.g. permission, permission.1 etc.) depending on the permission resource. The system determines which filter to apply (Global, Project or Repository permission) based on the [root] permission value. E.g. ADMIN is a global permission, PROJECT_ADMIN is a project permission and REPO_ADMIN is a repository permission. Note that the parameters for a given resource will be looked up in the order as they are listed below, that is e.g. for a project resource, if both projectId and projectKey are provided, the system will use projectId for the lookup.

Global permissions

The permission value under [root] is the only required and recognized parameter, as global permissions do not apply to a specific resource.

Example valid filter: permission=ADMIN.

Project permissions

  • [root]- specifies the project permission
  • [root].projectId - specifies the project ID to lookup the project by
  • [root].projectKey - specifies the project key to lookup the project by

Example valid filter: permission.1=PROJECT_ADMIN&permission.1.projectKey=TEST_PROJECT.

Repository permissions

  • [root]- specifies the repository permission
  • [root].projectId - specifies the repository ID to lookup the repository by
  • [root].projectKey and [root].repositorySlug- specifies the project key and repository slug to lookup the repository by; both values need to be provided for this look up to be triggered

Example valid filter: permission.2=REPO_ADMIN&permission.2.projectKey=TEST_PROJECT&permission.2.repositorySlug=test_repo.

Request

Query parameters

filter

string

permission.N

string

permission

string

group

string

Responses

A page of users.

application/json

RestApplicationUser
GET/api/latest/users
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/users' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }
PUT

Put api latest users

Update the currently authenticated user's details. The update will always be applied to the currently authenticated user.

Request

Request bodyapplication/json

The user update details

displayName

string

email

string

name

string

Responses

The updated user.

application/json

RestApplicationUser
PUT/api/latest/users
1 2 3 4 5 6 7 8 9 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/users' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "displayName": "Jane Citizen", "email": "jane@example.com", "name": "jcitizen" }'
200Response
1 2 3 4 5 6 7 8 9 { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }
PUT

Put api latest users credentials

Update the currently authenticated user's password.

Request

Request bodyapplication/json

The password update details

oldPassword

string

password

string

passwordConfirm

string

Responses

The user's password was successfully updated.

PUT/api/latest/users/credentials
1 2 3 4 5 6 7 8 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/users/credentials' \ --header 'Content-Type: application/json' \ --data '{ "oldPassword": "my-old-secret-password", "password": "my-secret-password", "passwordConfirm": "my-secret-password" }'
GET

Get api latest users {userSlug}

Retrieve the user matching the supplied userSlug.

Request

Path parameters

userSlug

string

Required

Responses

The user matching the supplied userSlug. Note, this may not be the user's username, always use the user.slug property.

application/json

RestApplicationUser
GET/api/latest/users/{userSlug}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/users/{userSlug}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true }
POST

Post api latest users {userSlug} avatar.png

Update the avatar for the user with the supplied slug.

This resource accepts POST multipart form data, containing a single image in a form-field named 'avatar'.

There are configurable server limits on both the dimensions (1024x1024 pixels by default) and uploaded file size (1MB by default). Several different image formats are supported, but PNG and JPEG are preferred due to the file size limit.

This resource has Cross-Site Request Forgery (XSRF) protection. To allow the request to pass the XSRF check the caller needs to send an X-Atlassian-Token HTTP header with the value no-check.

An example curl request to upload an image name 'avatar.png' would be:

1 curl -X POST -u username:password -H "X-Atlassian-Token: no-check" http://example.com/rest/api/latest/users/jdoe/avatar.png -F avatar=@avatar.png

Users are always allowed to update their own avatar. To update someone else's avatar the authenticated user must have global ADMIN permission, or global SYS_ADMIN permission to update a SYS_ADMIN user's avatar.

Request

Path parameters

userSlug

string

Required

Header parameters

X-Atlassian-Token

string

Request bodymultipart/form-data

Multipart form data containing a single image in a form-field named 'avatar'.

avatar

string

Responses

The avatar was uploaded successfully.

Headers

Location

string

POST/api/latest/users/{userSlug}/avatar.png
1 2 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/users/{userSlug}/avatar.png'
DEL

Delete api latest users {userSlug} avatar.png

Delete the avatar associated to a user.

Users are always allowed to delete their own avatar. To delete someone else's avatar the authenticated user must have global ADMIN permission, or global SYS_ADMIN permission to update a SYS_ADMIN user's avatar.

Request

Path parameters

userSlug

string

Required

Responses

The new avatar URL if the local avatar was successfully deleted or did not exist

application/json

RestNamedLink
DEL/api/latest/users/{userSlug}/avatar.png
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/users/{userSlug}/avatar.png' \ --header 'Accept: application/json'
200Response
1 2 3 4 { "name": "http", "href": "https://bitbucket.example.com/scm/awesomeproject/awesomerepo.git" }
GET

Get api latest users {userSlug} settings

Retrieve a map of user setting key values for a specific user identified by the user slug.

Request

Path parameters

userSlug

string

Required

Responses

The user settings for the specified user slug.

application/json

ExampleSettingsMap
GET/api/latest/users/{userSlug}/settings
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/users/{userSlug}/settings' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 { "string key": "string value", "boolean key": true, "long key": 10 }
POST

Post api latest users {userSlug} settings

Update the entries of a map of user setting key/values for a specific user identified by the user slug.

Request

Path parameters

userSlug

string

Required

Request bodyapplication/json

A map with the UserSettings entries which must be updated.

string key

string

boolean key

boolean

long key

number

Responses

The UserSettings were updated successfully

POST/api/latest/users/{userSlug}/settings
1 2 3 4 5 6 7 8 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/users/{userSlug}/settings' \ --header 'Content-Type: application/json' \ --data '{ "string key": "string value", "boolean key": true, "long key": 10 }'

Rate this page: