Developer
News and Updates
Get Support
Sign in
Get Support
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Server
Bitbucket Data Center / / Modules

Api

Postman Collection
OpenAPI
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}GET/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}/patchGET/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

Forge and OAuth2 apps cannot access this REST resource.

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

Forge and OAuth2 apps cannot access this REST resource.

Request

Request bodyapplication/json

audience

string

Required
enabled

boolean

message

string

Responses

The banner was set successfully

application/json

any

PUT/api/latest/admin/banner
1 2 3 4 5 6 7 8 9 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/admin/banner' \ --header 'Accept: application/json' \ --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.

Forge and OAuth2 apps cannot access this REST resource.

Request

This request has no parameters.

Responses

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

application/json

any

DEL/api/latest/admin/banner
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/admin/banner' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Request bodyapplication/json

id

string

Responses

The default branch has been set.

application/json

any

PUT/api/latest/admin/default-branch
1 2 3 4 5 6 7 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/admin/default-branch' \ --header 'Accept: application/json' \ --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.

Forge and OAuth2 apps cannot access this REST resource.

Request

This request has no parameters.

Responses

The default branch has been cleared.

application/json

any

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

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

Obtain the control plane PEM.

The authenticated user must have SYS_ADMIN permission.

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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, "deletable": true, "mutableDetails": true, "mutableGroups": 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.

Forge and OAuth2 apps cannot access this REST 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, "deletable": true, "mutableDetails": true, "mutableGroups": 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.

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST resource.

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, "license": "<encoded license text>", "status": { "serverId": "<actual server ID>", "currentNumberOfUsers": 2 } }
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.

Forge and OAuth2 apps cannot access this REST resource.

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, "license": "<encoded license text>", "status": { "serverId": "<actual server ID>", "currentNumberOfUsers": 2 } }
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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

Request

This request has no parameters.

Responses

The mail configuration was successfully deleted.

application/json

any

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

Get api latest admin mail-server sender-address

Retrieves the server email address

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

Request

This request has no parameters.

Responses

he server email address was successfully cleared.

application/json

any

DEL/api/latest/admin/mail-server/sender-address
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/admin/mail-server/sender-address' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Query parameters

name

array<string>

Required
permission

string

Required

Responses

The specified permission was granted to the specified user.

application/json

any

PUT/api/latest/admin/permissions/groups
1 2 3 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/admin/permissions/groups?name={name}&permission={permission}' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Query parameters

name

string

Required

Responses

All global permissions were revoked from the group.

application/json

any

DEL/api/latest/admin/permissions/groups
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/admin/permissions/groups?name={name}' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Query parameters

name

array<string>

Required
permission

string

Required

Responses

The requested permission was granted.

application/json

any

PUT/api/latest/admin/permissions/users
1 2 3 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/admin/permissions/users?name={name}&permission={permission}' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Query parameters

name

string

Required

Responses

All global permissions were revoked from the user.

application/json

any

DEL/api/latest/admin/permissions/users
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/admin/permissions/users?name={name}' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

userSlug

string

Required

Responses

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

application/json

any

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

Get api latest admin users

Retrieve a page of users.

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

Forge and OAuth2 apps cannot access this REST 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, "deletable": true, "mutableDetails": true, "mutableGroups": 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.

Forge and OAuth2 apps cannot access this REST 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, "deletable": true, "mutableDetails": true, "mutableGroups": 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.

Forge and OAuth2 apps cannot access this REST 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.

application/json

any

POST/api/latest/admin/users
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/admin/users?emailAddress={emailAddress}&displayName={displayName}&name={name}' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST 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, "deletable": true, "mutableDetails": true, "mutableGroups": 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Query parameters

name

string

Required

Responses

The CAPTCHA was successfully cleared.

application/json

any

DEL/api/latest/admin/users/captcha
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/admin/users/captcha?name={name}' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Request bodyapplication/json

name

string

password

string

passwordConfirm

string

Responses

The user's password was successfully updated.

application/json

any

PUT/api/latest/admin/users/credentials
1 2 3 4 5 6 7 8 9 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/admin/users/credentials' \ --header 'Accept: application/json' \ --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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Query parameters

name

string

Required

Responses

the user is erasable

application/json

any

GET/api/latest/admin/users/erasure
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/users/erasure?name={name}' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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, "deletable": true, "mutableDetails": true, "mutableGroups": 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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, "deletable": true, "mutableDetails": true, "mutableGroups": 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.

Forge and OAuth2 apps cannot access this REST 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

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST resource.

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": [ { "changeTme": 1359075920, "refChange": { "fromHash": "6053a1eaa1c009dd11092d09a72f3c41af1b59ad", "toHash": "d6edcbf924697ab811a867421dab60d954ccad99", "refId": "refs/heads/master", "type": "ADD", "ref": { "displayId": "master", "id": "refs/heads/master", "type": "BRANCH" } }, "fromRef": { "displayId": "master", "id": "refs/heads/master", "type": "BRANCH" }, "toRef": { "displayId": "master", "id": "refs/heads/master", "type": "BRANCH" }, "repository": { "relatedLinks": {}, "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "relatedLinks": {}, "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "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.

Forge and OAuth2 apps cannot access this REST resource.

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": [ { "updatedDate": 14490759200, "createdDate": 13590759200, "closedDate": 19990759200, "fromRef": { "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "displayId": "feature-ABC-1233", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "relatedLinks": {}, "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "relatedLinks": {}, "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "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" } ], "toRef": { "latestCommit": "babecafebabecafebabecafebabecafebabecafe", "displayId": "feature-ABC-1233", "id": "refs/heads/feature-ABC-123", "type": "BRANCH", "repository": { "relatedLinks": {}, "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "relatedLinks": {}, "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } }, "version": 2154, "closed": true, "open": true, "id": 1, "state": "DECLINED", "locked": true, "description": "It is a kludge, but put the tuple from the database in the cache.", "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

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

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 { "updatedDate": "<string>", "createdDate": "<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.

Forge and OAuth2 apps cannot access this REST resource.

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 { "updatedDate": "<string>", "createdDate": "<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.

Forge and OAuth2 apps cannot access this REST resource.

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 { "updatedDate": "<string>", "createdDate": "<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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

scriptId

string

Required

Responses

The hook script was deleted.

application/json

any

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

Get api latest hook-scripts {scriptId} content

Retrieves the hook script content.

This endpoint requires SYS_ADMIN permission.

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST resource.

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

Forge and OAuth2 apps cannot access this REST resource.

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

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

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", "relatedLinks": {}, "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "relatedLinks": {}, "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

levelName

string

Required
loggerName

string

Required

Responses

The log level was successfully changed.

application/json

any

PUT/api/latest/logs/logger/{loggerName}/{levelName}
1 2 3 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/logs/logger/{loggerName}/{levelName}' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

levelName

string

Required

Responses

The log level was successfully changed.

application/json

any

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

Post api latest markup preview

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

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

jobId

string

Required

Responses

The job has successfully been marked for cancellation

application/json

any

POST/api/latest/migration/exports/{jobId}/cancel
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/migration/exports/{jobId}/cancel' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST 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>", "subject": "job", "severity": "INFO", "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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

jobId

string

Required

Responses

The job has successfully been marked for cancellation.

application/json

any

POST/api/latest/migration/imports/{jobId}/cancel
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/migration/imports/{jobId}/cancel' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST 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>", "subject": "job", "severity": "INFO", "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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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": [ { "relatedLinks": {}, "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "relatedLinks": {}, "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "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.

Forge and OAuth2 apps cannot access this REST 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": { "relatedLinks": {}, "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "relatedLinks": {}, "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

jobId

string

Required

Responses

The migration job was successfully marked for cancellation.

application/json

any

POST/api/latest/migration/mesh/{jobId}/cancel
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/migration/mesh/{jobId}/cancel' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST 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>", "subject": "job", "severity": "INFO", "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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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": [ { "relatedLinks": {}, "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "relatedLinks": {}, "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "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.

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Request bodyapplication/json

The project.

avatar

string

avatarUrl

string

key

string

id

integer

links

object

Responses

The newly created project.

application/json

RestProject
POST/api/latest/projects
1 2 3 4 5 6 7 8 9 10 11 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", "id": 2154, "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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

projectKey

string

Required

Request bodyapplication/json

Project parameters to update.

avatar

string

avatarUrl

string

key

string

id

integer

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 11 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", "id": 2154, "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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

projectKey

string

Required

Responses

The project matching the supplied projectKey was deleted.

application/json

any

DEL/api/latest/projects/{projectKey}
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

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": { "updatedDate": "<string>", "createdDate": "<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.

Forge and OAuth2 apps cannot access this REST resource.

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": { "updatedDate": "<string>", "createdDate": "<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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

projectKey

string

Required
scriptId

string

Required

Responses

The hook script was successfully deleted.

application/json

any

DEL/api/latest/projects/{projectKey}/hook-scripts/{scriptId}
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/hook-scripts/{scriptId}' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

projectKey

string

Required

Query parameters

name

string

permission

string

Responses

The requested permission was granted.

application/json

any

PUT/api/latest/projects/{projectKey}/permissions/groups
1 2 3 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/groups' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

projectKey

string

Required

Query parameters

name

string

Responses

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

application/json

any

DEL/api/latest/projects/{projectKey}/permissions/groups
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/groups' \ --header 'Accept: application/json'
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

Forge and OAuth2 apps cannot access this REST resource.

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.

Forge and OAuth2 apps cannot access this REST 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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

projectKey

string

Required

Query parameters

name

string

permission

string

Responses

The requested permission was granted.

application/json

any

PUT/api/latest/projects/{projectKey}/permissions/users
1 2 3 curl --request PUT \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/users' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST resource.

Request

Path parameters

projectKey

string

Required

Query parameters

name

string

Responses

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

application/json

any

DEL/api/latest/projects/{projectKey}/permissions/users
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/users' \ --header 'Accept: application/json'
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.

Forge and OAuth2 apps cannot access this REST 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