Server
Bitbucket Data Center / / Modules

System Maintenance

Postman Collection
OpenAPI
Operations
DEL/audit/latest/notification-settings/retention-config-reviewGET/policies/latest/admin/repos/archivePUT/policies/latest/admin/repos/archiveGET/policies/latest/admin/repos/deletePUT/policies/latest/admin/repos/deleteGET/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/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/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/application-propertiesPOST/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/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/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/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
DEL

Dismiss retention config notification

Dismisses the retention config review notification displayed by the audit plugin for the user that's currently logged in.

Request

This request has no parameters.

Responses

A blank response

application/json

any

DEL/audit/latest/notification-settings/retention-config-review
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/audit/latest/notification-settings/retention-config-review' \ --header 'Accept: application/json'
GET

Get repository archive policy

Retrieves the repository archive policy for the instance. The user must be authenticated to access this resource.

Request

This request has no parameters.

Responses

A response containing the repository archive policy for the instance

application/json

RestRepositoryPolicy
GET/policies/latest/admin/repos/archive
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/policies/latest/admin/repos/archive' \ --header 'Accept: application/json'
200Response
1 2 3 { "permission": "ADMIN" }
PUT

Update repository archive policy

Sets the repository archive policy for the instance.

The authenticated user must have SYS_ADMIN permission.

Request

Request bodyapplication/json

The request containing the details of the policy.

permission

string

Responses

A response containing the repository archive policy for the instance

application/json

RestRepositoryPolicy
PUT/policies/latest/admin/repos/archive
1 2 3 4 5 6 7 curl --request PUT \ --url 'http://{baseurl}/rest/policies/latest/admin/repos/archive' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "permission": "ADMIN" }'
200Response
1 2 3 { "permission": "ADMIN" }
GET

Get repository delete policy

Retrieves the repository delete policy for the instance. The user must be authenticated to access this resource.

Request

This request has no parameters.

Responses

A response containing the repository delete policy for the instance

application/json

RestRepositoryPolicy
GET/policies/latest/admin/repos/delete
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/policies/latest/admin/repos/delete' \ --header 'Accept: application/json'
200Response
1 2 3 { "permission": "ADMIN" }
PUT

Update the repository delete policy

Sets the repository delete policy for the instance.

The authenticated user must have SYS_ADMIN permission.

Request

Request bodyapplication/json

The request containing the details of the policy.

permission

string

Responses

A response containing the repository delete policy for the instance

application/json

RestRepositoryPolicy
PUT/policies/latest/admin/repos/delete
1 2 3 4 5 6 7 curl --request PUT \ --url 'http://{baseurl}/rest/policies/latest/admin/repos/delete' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "permission": "ADMIN" }'
200Response
1 2 3 { "permission": "ADMIN" }
GET

Get announcement banner

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

Request

This request has no parameters.

Responses

The requested banner

application/json

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

Update/Set announcement banner

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

Request

Request bodyapplication/json

audience

string

Required
enabled

boolean

message

string

Responses

The banner was set successfully

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

Delete announcement banner

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

Request

This request has no parameters.

Responses

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

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

Get cluster node information

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

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

Request

This request has no parameters.

Responses

A response containing information about the cluster

application/json

RestClusterInformation
GET/api/latest/admin/cluster
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/cluster' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 { "localNode": { "buildVersion": "7.0.0", "local": true, "name": "foo", "id": "d4fde8b1-2504-4998-a0ba-14fbe98edd4d", "address": { "address": "node.example.com", "port": 8230 } }, "running": true, "nodes": [ { "buildVersion": "7.0.0", "local": true, "name": "foo", "id": "d4fde8b1-2504-4998-a0ba-14fbe98edd4d", "address": { "address": "node.example.com", "port": 8230 } } ] }
GET

Get the default branch

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

Request

This request has no parameters.

Responses

The configured global default branch.

application/json

any

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

Update/Set default branch

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

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

Request

Request bodyapplication/json

id

string

Responses

The default branch has been set.

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

Clear default branch

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

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

Request

This request has no parameters.

Responses

The default branch has been cleared.

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

Get the control plane PEM

Obtain the control plane PEM.

The authenticated user must have SYS_ADMIN permission.

Request

This request has no parameters.

Responses

The control plane PEM.

text/plain

any

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

Generate Mesh connectivity report

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

The authenticated user must have SYS_ADMIN permission.

Request

This request has no parameters.

Responses

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

application/json

RestMeshConnectivityReport
GET/api/latest/admin/git/mesh/diagnostics/connectivity
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/admin/git/mesh/diagnostics/connectivity' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 { "reports": [ { "summaries": [ { "summary": { "reachable": true, "roundTripTime": 100, "errorMessage": "Unable to connect to the node." }, "node": { "name": "My Node", "id": "1", "type": "BITBUCKET" } } ], "node": { "name": "My Node", "id": "1", "type": "BITBUCKET" } } ] }
GET

Get all registered Mesh nodes

Get all the registered Mesh nodes.

The authenticated user must have SYS_ADMIN permission.

Request

This request has no parameters.

Responses

The list of registered Mesh nodes.

application/json

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

Register new Mesh node

Register a new Mesh node.

The authenticated user must have SYS_ADMIN permission.

Request

Request bodyapplication/json

The request specifying the new Mesh node.

lastSeenDate

number

offline

boolean

rpcUrl

string

rpcId

string

name

string

id

string

state

string

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

Get Mesh node

Get the registered Mesh node that matches the supplied ID.

The authenticated user must have SYS_ADMIN permission.

Request

Path parameters

id

string

Required

Responses

The Mesh node that matches the ID.

application/json

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

Update Mesh node

Update a Mesh node.

The authenticated user must have SYS_ADMIN permission.

Request

Path parameters

id

string

Required

Request bodyapplication/json

The request specifying the updated Mesh node.

lastSeenDate

number

offline

boolean

rpcUrl

string

rpcId

string

name

string

id

string

state

string

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

Get support zips for all Mesh nodes

Get the support zips for all the Mesh nodes.

The authenticated user must have SYS_ADMIN permission.

Request

This request has no parameters.

Responses

The support zips for all the Mesh nodes.

application/octet-stream

any

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

Get support zip for node

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

The authenticated user must have SYS_ADMIN permission.

Request

Path parameters

id

string

Required

Responses

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

application/octet-stream

any

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

Get license details

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

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

Request

This request has no parameters.

Responses

The currently-installed license.

application/json

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

Update license

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

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

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

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

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

Request

Request bodyapplication/json

a JSON payload containing the encoded license to apply

license

string

Responses

The newly-installed license.

application/json

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

Get mail configuration

Retrieves the current mail configuration.

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

Request

This request has no parameters.

Responses

The mail configuration

application/json

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

Update mail configuration

Updates the mail configuration.

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

Request

Request bodyapplication/json

hostname

string

password

string

port

integer

protocol

string

requireStartTls

boolean

senderAddress

string

useStartTls

boolean

username

string

Responses

The updated mail configuration.

application/json

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

Delete mail configuration

Deletes the current mail configuration.

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

Request

This request has no parameters.

Responses

The mail configuration was successfully deleted.

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

Get server mail address

Retrieves the server email address

Request

This request has no parameters.

Responses

The server email address

application/json

any

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

Update server mail address

Updates the server email address

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

Request

Request bodyapplication/json

string

Responses

The from address used in notification emails

application/json

any

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

Update mail configuration

Clears the server email address.

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

Request

This request has no parameters.

Responses

he server email address was successfully cleared.

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

Get rate limit history

Retrieves the recent rate limit history for the instance.

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

Request

Query parameters

order

string

start

number

limit

number

Responses

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

application/json

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

Get rate limit settings

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

Request

This request has no parameters.

Responses

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

application/json

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

Set rate limit

Sets the rate limit settings for the instance.

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

Request

Request bodyapplication/json

Sets the rate limit settings for the instance.

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

defaultSettings

object

enabled

boolean

Responses

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

application/json

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

Get rate limit settings for user

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

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

Request

Query parameters

filter

string

start

number

limit

number

Responses

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

application/json

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

Set rate limit settings for users

Sets the given rate limit settings for the given users.

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

Request

Request bodyapplication/json

settings

object

usernames

array<string>

whitelisted

boolean

Responses

A response containing the updated user settings.

application/json

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

Get user specific rate limit settings

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

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

Request

Path parameters

userSlug

string

Required

Responses

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

application/json

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

Set rate limit settings for user

Sets the given rate limit settings for the given user.

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

Request

Path parameters

userSlug

string

Required

Request bodyapplication/json

settings

object

whitelisted

boolean

Responses

A response containing the updated user settings

application/json

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

Delete user specific rate limit settings

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

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

Request

Path parameters

userSlug

string

Required

Responses

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

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

Get application properties

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

Request

This request has no parameters.

Responses

The application properties

application/json

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

Create a new hook script

Create a new hook script.

This endpoint requires SYS_ADMIN permission.

Request

Request bodymultipart/form-data

The multipart form data containing the hook script

content

string

description

string

name

string

type

string

Responses

The newly created hook script.

application/json

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

Get a hook script

Retrieves a hook script by ID.

Request

Path parameters

scriptId

string

Required

Responses

The hook script.

application/json

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

Update a hook script

Updates a hook script.

This endpoint requires SYS_ADMIN permission.

Request

Path parameters

scriptId

string

Required

Request body*/*

The multipart form data containing the hook script

content

string

description

string

name

string

Responses

The updated hook script.

application/json

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

Delete a hook script.

Deletes a registered hook script.

This endpoint requires SYS_ADMIN permission.

Request

Path parameters

scriptId

string

Required

Responses

The hook script was deleted.

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

Get hook script content

Retrieves the hook script content.

This endpoint requires SYS_ADMIN permission.

Request

Path parameters

scriptId

string

Required

Responses

The hook script content.

application/json

any

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

Get all labels

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

Request

Query parameters

prefix

string

start

number

limit

number

Responses

Page of returned labels.

application/json

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

Get label

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

Request

Path parameters

labelName

string

Required

Responses

The label.

application/json

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

Get labelables for label

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

Request

Path parameters

labelName

string

Required

Query parameters

type

string

start

number

limit

number

Responses

The page of labelables.

application/json

object
GET/api/latest/labels/{labelName}/labeled
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/labels/{labelName}/labeled' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 { "values": [ { "labelableType": "REPOSITORY", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "scope": "REPOSITORY", "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "scope": "REPOSITORY", "project": { "scope": "PROJECT", "avatar": "<string>", "namespace": "<string>", "description": "The description for my cool project", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "description": "My repo description", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "scope": "PROJECT", "avatar": "<string>", "namespace": "<string>", "description": "The description for my cool project", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "description": "My repo description", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" } ], "size": 1, "nextPageStart": 2154, "isLastPage": true, "start": 2154, "limit": 25 }
GET

Get current log level

Retrieve the current log level for a given logger.

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

Request

Path parameters

loggerName

string

Required

Responses

The log level of the logger.

application/json

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

Set log level

Set the current log level for a given logger.

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

Request

Path parameters

levelName

string

Required
loggerName

string

Required

Responses

The log level was successfully changed.

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

Get root log level

Retrieve the current log level for the root logger.

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

Request

This request has no parameters.

Responses

The log level of the logger.

application/json

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

Set root log level

Set the current log level for the root logger.

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

Request

Path parameters

levelName

string

Required

Responses

The log level was successfully changed.

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

Start export job

Starts a background job that exports the selected repositories.

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

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

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

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

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

Now, a single repository can be selected like this:

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

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

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

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

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

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

Request

Request bodyapplication/json

The request

exportLocation

string

repositoriesRequest

object

Required

Responses

Details about the export job.

application/json

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

Preview export

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

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

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

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

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

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

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

Request

Request bodyapplication/json

the export request

exportLocation

string

repositoriesRequest

object

Required

Responses

The effectively selected projects and repositories.

application/json

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

Get export job details

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

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

Request

Path parameters

jobId

string

Required

Responses

The job, including status and progress information.

application/json

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

Cancel export job

Requests the cancellation of an export job.

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

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

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

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

Request

Path parameters

jobId

string

Required

Responses

The job has successfully been marked for cancellation

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

Get job messages

Gets the messages generated by the job.

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

  • INFO
  • WARN
  • ERROR

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

Request

Path parameters

jobId

string

Required

Query parameters

severity

string

subject

string

start

number

limit

number

Responses

The messages generated by this job.

application/json

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

Start import job

Starts a background job that imports the specified archive.

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

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

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

Request

Request bodyapplication/json

The request

archivePath

string

Responses

Details about the export job.

application/json

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

Get import job status

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

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

Request

Path parameters

jobId

string

Required

Responses

The job, including status and progress information.

application/json

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

Cancel import job

Requests the cancellation of an import job.

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

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

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

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

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

Request

Path parameters

jobId

string

Required

Responses

The job has successfully been marked for cancellation.

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

Get import job messages

Gets the messages generated by the job.

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

  • INFO
  • WARN
  • ERROR

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

Request

Path parameters

jobId

string

Required

Query parameters

severity

string

subject

string

start

number

limit

number

Responses

The messages generated by this job.

application/json

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

Start Mesh migration job

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

Only 1 job is supported per cluster.

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

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

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

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

Now, a single repository can be selected like this:

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

Multiple repositories can be selected like this:

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

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

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

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

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

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

Request

Request bodyapplication/json

all

boolean

maxBytesPerSecond

object

projectIds

array<integer>

repositoryIds

array<integer>

Responses

The started job

application/json

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

Preview Mesh migration

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

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

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

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

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

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

Request

Request bodyapplication/json

The export request

all

boolean

maxBytesPerSecond

object

projectIds

array<integer>

repositoryIds

array<integer>

Responses

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

application/json

ExamplePreviewMigration
POST/api/latest/migration/mesh/preview
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/migration/mesh/preview' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "all": true, "maxBytesPerSecond": { "asLong": 2154, "present": true }, "projectIds": [ 2154 ], "repositoryIds": [ 2154 ] }'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 { "repositories": [ { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "scope": "REPOSITORY", "project": { "scope": "PROJECT", "avatar": "<string>", "namespace": "<string>", "description": "The description for my cool project", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "description": "My repo description", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" } ] }
GET

Find repositories by Mesh migration state

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

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

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

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

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

Request

Query parameters

migrationId

string

projectKey

string

name

string

state

string

remote

string

start

number

limit

number

Responses

A page of repositories matching the specified criteria.

application/json

object
GET/api/latest/migration/mesh/repos
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/migration/mesh/repos' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 { "values": [ { "migrationState": "QUEUED", "repository": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "scope": "REPOSITORY", "origin": { "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "scope": "REPOSITORY", "project": { "scope": "PROJECT", "avatar": "<string>", "namespace": "<string>", "description": "The description for my cool project", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "description": "My repo description", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" }, "project": { "scope": "PROJECT", "avatar": "<string>", "namespace": "<string>", "description": "The description for my cool project", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL" }, "scmId": "git", "slug": "my-repo", "archived": true, "forkable": true, "description": "My repo description", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE" } } ], "size": 1, "nextPageStart": 2154, "isLastPage": true, "start": 2154, "limit": 25 }
GET

Get all Mesh migration job summaries

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

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

Request

Query parameters

start

number

limit

number

Responses

The summary of the migration job.

application/json

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

Get summary for Mesh migration job

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

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

Request

This request has no parameters.

Responses

The summary of the currently active migration job.

application/json

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

Get Mesh migration job details

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

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

Request

Path parameters

jobId

string

Required

Responses

The details of the migration job.

application/json

any

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

Cancel Mesh migration job

Requests the cancellation of a migration job.

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

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

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

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

Request

Path parameters

jobId

string

Required

Responses

The migration job was successfully marked for cancellation.

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

Get Mesh migration job messages

Gets the messages generated by the job.

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

1 2 3 - INFO - WARN - ERROR

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

Request

Path parameters

jobId

string

Required

Query parameters

severity

string

subject

string

start

number

limit

number

Responses

The details of the migration job.

application/json

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

Get Mesh migration job summary

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

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

Request

Path parameters

jobId

string

Required

Responses

The summary of the migration job.

application/json

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

Get all users

Retrieve a page of users, optionally run through provided filters.

Only authenticated users may call this resource.

Permission Filters

The following three sub-sections list parameters supported for permission filters (where [root] is the root permission filter name, e.g. permission, permission.1 etc.) depending on the permission resource. The system determines which filter to apply (Global, Project or Repository permission) based on the [root] permission value. E.g. ADMIN is a global permission, PROJECT_ADMIN is a project permission and REPO_ADMIN is a repository permission. Note that the parameters for a given resource will be looked up in the order as they are listed below, that is e.g. for a project resource, if both projectId and projectKey are provided, the system will use projectId for the lookup.

Global permissions

The permission value under [root] is the only required and recognized parameter, as global permissions do not apply to a specific resource.

Example valid filter: permission=ADMIN.

Project permissions

  • [root]- specifies the project permission
  • [root].projectId - specifies the project ID to lookup the project by
  • [root].projectKey - specifies the project key to lookup the project by

Example valid filter: permission.1=PROJECT_ADMIN&permission.1.projectKey=TEST_PROJECT.

Repository permissions

  • [root]- specifies the repository permission
  • [root].projectId - specifies the repository ID to lookup the repository by
  • [root].projectKey and [root].repositorySlug- specifies the project key and repository slug to lookup the repository by; both values need to be provided for this look up to be triggered

Example valid filter: permission.2=REPO_ADMIN&permission.2.projectKey=TEST_PROJECT&permission.2.repositorySlug=test_repo.

Request

Query parameters

filter

string

permission.N

string

permission

string

group

string

Responses

A page of users.

application/json

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

Update user details

Update the currently authenticated user's details. The update will always be applied to the currently authenticated user.

Request

Request bodyapplication/json

The user update details

displayName

string

email

string

name

string

Responses

The updated user.

application/json

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

Set password

Update the currently authenticated user's password.

Request

Request bodyapplication/json

The password update details

oldPassword

string

password

string

passwordConfirm

string

Responses

The user's password was successfully updated.

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

Get user

Retrieve the user matching the supplied userSlug.

Request

Path parameters

userSlug

string

Required

Responses

The user matching the supplied userSlug. Note, this may not be the user's username, always use the user.slug property.

application/json

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

Update user avatar

Update the avatar for the user with the supplied slug.

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

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

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

An example curl request to upload an image name 'avatar.png' would be:

1 curl -X POST -u username:password -H "X-Atlassian-Token: no-check" http://example.com/rest/api/latest/users/jdoe/avatar.png -F avatar=@avatar.png

Users are always allowed to update their own avatar. To update someone else's avatar the authenticated user must have global ADMIN permission, or global SYS_ADMIN permission to update a SYS_ADMIN user's avatar.

Request

Path parameters

userSlug

string

Required

Header parameters

X-Atlassian-Token

string

Request bodymultipart/form-data

Multipart form data containing a single image in a form-field named 'avatar'.

avatar

string

Responses

The avatar was uploaded successfully.

Headers

Location

string

POST/api/latest/users/{userSlug}/avatar.png
1 2 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/users/{userSlug}/avatar.png'
DEL

Delete user avatar

Delete the avatar associated to a user.

Users are always allowed to delete their own avatar. To delete someone else's avatar the authenticated user must have global ADMIN permission, or global SYS_ADMIN permission to update a SYS_ADMIN user's avatar.

Request

Path parameters

userSlug

string

Required

Responses

The new avatar URL if the local avatar was successfully deleted or did not exist

application/json

RestNamedLink
DEL/api/latest/users/{userSlug}/avatar.png
1 2 3 curl --request DELETE \ --url 'http://{baseurl}/rest/api/latest/users/{userSlug}/avatar.png' \ --header 'Accept: application/json'
200Response
1 2 3 4 { "href": "https://bitbucket.example.com/scm/awesomeproject/awesomerepo.git", "name": "http" }
GET

Get user settings

Retrieve a map of user setting key values for a specific user identified by the user slug.

Request

Path parameters

userSlug

string

Required

Responses

The user settings for the specified user slug.

application/json

ExampleSettingsMap
GET/api/latest/users/{userSlug}/settings
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/api/latest/users/{userSlug}/settings' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 { "boolean key": true, "string key": "string value", "long key": 10 }
POST

Update user settings

Update the entries of a map of user setting key/values for a specific user identified by the user slug.

Request

Path parameters

userSlug

string

Required

Request bodyapplication/json

A map with the UserSettings entries which must be updated.

boolean key

boolean

string key

string

long key

number

Responses

The UserSettings were updated successfully

POST/api/latest/users/{userSlug}/settings
1 2 3 4 5 6 7 8 curl --request POST \ --url 'http://{baseurl}/rest/api/latest/users/{userSlug}/settings' \ --header 'Content-Type: application/json' \ --data '{ "boolean key": true, "string key": "string value", "long key": 10 }'

Rate this page: