• Authentication
  • Builds and Deployments
  • Capabilities
  • Dashboard
  • Deprecated
  • Jira Integration
  • Markup
  • Mirroring (Mirror)
  • Mirroring (Upstream)
  • Permission Management
  • Project
  • Pull Requests
  • Repository
  • Security
  • System Maintenance
  • Other operations
Server
Bitbucket Data Center / / Modules

Mirroring (Upstream)

Postman Collection
OpenAPI
GET

Get preferred mirror

Retrieves the current user's preferred mirror server

Request

This request has no parameters.

Responses

the preferred mirror server

application/json

RestMirrorServer
GET/mirroring/latest/account/settings/preferred-mirror
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/mirroring/latest/account/settings/preferred-mirror' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 { "enabled": true, "name": "Mirror", "id": "B0F5-CS21-45C2-CCK3", "lastSeenDate": "<string>", "mirrorType": "SINGLE", "productType": "Bitbucket", "productVersion": "8.0.0", "baseUrl": "http://vietnam.example.com" }
POST

Set preferred mirror

Sets the mirror specified by a mirror ID as the current user's preferred mirror

Request

Request bodyapplication/json

the mirror ID

string

Responses

an empty response indicating that the user setting has been updated

POST/mirroring/latest/account/settings/preferred-mirror
1 2 3 4 curl --request POST \ --url 'http://{baseurl}/rest/mirroring/latest/account/settings/preferred-mirror' \ --header 'Content-Type: application/json' \ --data '"<string>"'
DEL

Remove preferred mirror

Removes the current user's preferred mirror

Request

This request has no parameters.

Responses

an empty response indicating that the user setting has been updated

DEL/mirroring/latest/account/settings/preferred-mirror
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/mirroring/latest/account/settings/preferred-mirror'
GET

Get analytics settings from upstream

Gets the analytics settings from the mirroring upstream

Request

This request has no parameters.

Responses

The analytics settings from upstream

application/json

RestAnalyticsSettings
GET/mirroring/latest/analyticsSettings
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/mirroring/latest/analyticsSettings' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 { "supportEntitlementNumber": "SEN-500", "serverTime": 1640390400000, "canCollectAnalytics": true }
POST

Authenticate on behalf of a user

Authenticates on behalf of a user. Used by mirrors to check the credentials supplied to them by users. If successful a user and their effective permissions are returned as follows -

  • For SSH credentials - all the effective user permissions are returned.
  • For all other credentials - the highest global permission is returned along with highest repository permission if repository ID is also provided in the request.

Currently only username/password, bearer token and SSH credentials are supported.

Request

Request bodyapplication/json

credentials

oneOf [RestUsernamePasswordCredentials, RestBearerTokenCredentials, RestSshCredentials]

Required
repositoryId

integer

requiredPermissionsOnly

boolean

Responses

The user for the supplied credentials and their effective permissions}.

application/json

RestApplicationUserWithPermissions
POST/mirroring/latest/authenticate
1 2 3 4 5 6 7 8 9 curl --request POST \ --url 'http://{baseurl}/rest/mirroring/latest/authenticate' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "credentials": {}, "repositoryId": 2154, "requiredPermissionsOnly": true }'
200Response
1 2 3 4 5 6 7 8 9 10 { "effectivePermissions": {}, "id": 101, "type": "NORMAL", "displayName": "Jane Citizen", "slug": "jcitizen", "active": true, "name": "jcitizen", "emailAddress": "jane@example.com" }
GET

Get all mirrors

Returns a list of mirrors

Request

Query parameters

start

number

limit

number

Responses

a page of mirrors

application/json

object
GET/mirroring/latest/mirrorServers
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/mirroring/latest/mirrorServers' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 { "values": [ { "enabled": true, "name": "Mirror", "id": "B0F5-CS21-45C2-CCK3", "lastSeenDate": "<string>", "mirrorType": "SINGLE", "productType": "Bitbucket", "productVersion": "8.0.0", "baseUrl": "http://vietnam.example.com" } ], "size": 1, "limit": 25, "start": 2154, "isLastPage": true, "nextPageStart": 2154 }
GET

Get mirror by ID

Returns the mirror specified by a mirror ID

Request

Path parameters

mirrorId

string

Required

Responses

the mirror

application/json

RestMirrorServer
GET/mirroring/latest/mirrorServers/{mirrorId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/mirroring/latest/mirrorServers/{mirrorId}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 { "enabled": true, "name": "Mirror", "id": "B0F5-CS21-45C2-CCK3", "lastSeenDate": "<string>", "mirrorType": "SINGLE", "productType": "Bitbucket", "productVersion": "8.0.0", "baseUrl": "http://vietnam.example.com" }
PUT

Upgrade add-on for a mirror

Upgrades the add-on for the mirror server in question This endpoint can only be called by the mirror instance or system administrators
Since 5.8

Request

Path parameters

mirrorId

string

Required

Request bodyapplication/json

addonDescriptorUri

string

baseUrl

string

productType

string

productVersion

string

Responses

the mirror

application/json

RestMirrorServer
PUT/mirroring/latest/mirrorServers/{mirrorId}
1 2 3 4 5 6 7 8 9 10 curl --request PUT \ --url 'http://{baseurl}/rest/mirroring/latest/mirrorServers/{mirrorId}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "addonDescriptorUri": "https://bitbucket-eu.example.com:7990/bitbucket/rest/mirroring/1.0/descriptor", "baseUrl": "https://bitbucket-eu.example.com:7990/bitbucket", "productType": "Bitbucket", "productVersion": "8.0.0" }'
200Response
1 2 3 4 5 6 7 8 9 10 { "enabled": true, "name": "Mirror", "id": "B0F5-CS21-45C2-CCK3", "lastSeenDate": "<string>", "mirrorType": "SINGLE", "productType": "Bitbucket", "productVersion": "8.0.0", "baseUrl": "http://vietnam.example.com" }
DEL

Delete mirror by ID

Removes a mirror, disabling all access and notifications for the mirror server in question

Request

Path parameters

mirrorId

string

Required

Responses

an empty response indicating that the mirror has been removed

DEL/mirroring/latest/mirrorServers/{mirrorId}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/mirroring/latest/mirrorServers/{mirrorId}'
POST

Publish RepositoryMirrorEvent

Publishes a RepositoryMirrorEvent on the event queue.

Request

Path parameters

mirrorId

string

Required

Request bodyapplication/json

mirrorRepoId

integer

type

string

upstreamRepoId

string

Responses

The event was successfully placed on the queue

POST/mirroring/latest/mirrorServers/{mirrorId}/events
1 2 3 4 5 6 7 8 curl --request POST \ --url 'http://{baseurl}/rest/mirroring/latest/mirrorServers/{mirrorId}/events' \ --header 'Content-Type: application/json' \ --data '{ "mirrorRepoId": 42, "type": "SYNCHRONIZED", "upstreamRepoId": "24" }'
GET

Get mirror auth token

Returns an authentication token for the mirror server in question

Request

Path parameters

mirrorId

string

Required

Responses

the mirror auth token

application/json

RestMirrorAuthToken

GET/mirroring/latest/mirrorServers/{mirrorId}/token
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/mirroring/latest/mirrorServers/{mirrorId}/token' \ --header 'Accept: application/json'
GET

Get HTML for remote-connect web-panel on mirror

Gets the rendered HTML that is needed to get the remote connect web-panel on the mirror.

Request

Path parameters

mirrorId

string

Required

Responses

default response

text/html

any

GET/mirroring/latest/mirrorServers/{mirrorId}/webPanels/config
1 2 curl --request GET \ --url 'http://{baseurl}/rest/mirroring/latest/mirrorServers/{mirrorId}/webPanels/config'
GET

Get project

Returns the requested project using its primary key ID.
Since 6.7

Request

Path parameters

projectId

string

Required

Responses

The project with the specified ID

application/json

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

Get hashes for repositories in project

Returns a page of repositories for a given project, enriched with a content hash

Request

Path parameters

projectId

string

Required

Query parameters

includeDefaultBranch

string

start

number

limit

number

Responses

A page of repositories with content hashes

application/json

object
GET/mirroring/latest/projects/{projectId}/repos
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/mirroring/latest/projects/{projectId}/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 69 70 { "values": [ { "properties": { "defaultBranchId": "refs/heads/master", "metadataHash": "11e5cd17e8d74d84a11f2c8a6bbc6ae0a2b69059e54030f49214c94d980364c1", "contentHash": "457389a0b871fb61012a7351d09aefc0cf1c57c306449d4b5df4d2f381df8433" }, "name": "My repo", "id": 2154, "state": "AVAILABLE", "public": true, "scmId": "git", "slug": "my-repo", "scope": "REPOSITORY", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "archived": true, "forkable": true, "origin": { "name": "My repo", "id": 2154, "state": "AVAILABLE", "public": true, "scmId": "git", "slug": "my-repo", "scope": "REPOSITORY", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "archived": true, "forkable": true, "description": "My repo description", "project": { "name": "My Cool Project", "key": "PRJ", "id": 2154, "type": "NORMAL", "public": true, "scope": "PROJECT", "avatar": "<string>", "description": "The description for my cool project", "namespace": "<string>" } }, "description": "My repo description", "project": { "name": "My Cool Project", "key": "PRJ", "id": 2154, "type": "NORMAL", "public": true, "scope": "PROJECT", "avatar": "<string>", "description": "The description for my cool project", "namespace": "<string>" } } ], "size": 1, "limit": 25, "start": 2154, "isLastPage": true, "nextPageStart": 2154 }
GET

Get content hashes for repositories

Returns a page of repositories enriched with a content hash and default branch

Request

Query parameters

includeDefaultBranch

string

Responses

A page of repositories with content hashes and default branch

application/json

EnrichedRepository
GET/mirroring/latest/repos
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/mirroring/latest/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 { "properties": { "defaultBranchId": "refs/heads/master", "metadataHash": "11e5cd17e8d74d84a11f2c8a6bbc6ae0a2b69059e54030f49214c94d980364c1", "contentHash": "457389a0b871fb61012a7351d09aefc0cf1c57c306449d4b5df4d2f381df8433" }, "name": "My repo", "id": 2154, "state": "AVAILABLE", "public": true, "scmId": "git", "slug": "my-repo", "scope": "REPOSITORY", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "archived": true, "forkable": true, "origin": { "name": "My repo", "id": 2154, "state": "AVAILABLE", "public": true, "scmId": "git", "slug": "my-repo", "scope": "REPOSITORY", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "archived": true, "forkable": true, "description": "My repo description", "project": { "name": "My Cool Project", "key": "PRJ", "id": 2154, "type": "NORMAL", "public": true, "scope": "PROJECT", "avatar": "<string>", "description": "The description for my cool project", "namespace": "<string>" } }, "description": "My repo description", "project": { "name": "My Cool Project", "key": "PRJ", "id": 2154, "type": "NORMAL", "public": true, "scope": "PROJECT", "avatar": "<string>", "description": "The description for my cool project", "namespace": "<string>" } }
GET

Get content hash for a repository

Returns a repository enriched with a content hash and default branch

Request

Path parameters

repoId

string

Required

Query parameters

includeDefaultBranch

boolean

Responses

The repository with the specified repoId

application/json

EnrichedRepository
GET/mirroring/latest/repos/{repoId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/mirroring/latest/repos/{repoId}' \ --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 { "properties": { "defaultBranchId": "refs/heads/master", "metadataHash": "11e5cd17e8d74d84a11f2c8a6bbc6ae0a2b69059e54030f49214c94d980364c1", "contentHash": "457389a0b871fb61012a7351d09aefc0cf1c57c306449d4b5df4d2f381df8433" }, "name": "My repo", "id": 2154, "state": "AVAILABLE", "public": true, "scmId": "git", "slug": "my-repo", "scope": "REPOSITORY", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "archived": true, "forkable": true, "origin": { "name": "My repo", "id": 2154, "state": "AVAILABLE", "public": true, "scmId": "git", "slug": "my-repo", "scope": "REPOSITORY", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "archived": true, "forkable": true, "description": "My repo description", "project": { "name": "My Cool Project", "key": "PRJ", "id": 2154, "type": "NORMAL", "public": true, "scope": "PROJECT", "avatar": "<string>", "description": "The description for my cool project", "namespace": "<string>" } }, "description": "My repo description", "project": { "name": "My Cool Project", "key": "PRJ", "id": 2154, "type": "NORMAL", "public": true, "scope": "PROJECT", "avatar": "<string>", "description": "The description for my cool project", "namespace": "<string>" } }
GET

Get mirrors for repository

Returns a page of mirrors for a repository. This resource will return all mirrors along with authorized links to the mirror's repository REST resource. To determine if a repository is available on the mirror, the returned URL needs to be called.

Request

Path parameters

repoId

string

Required

Responses

The mirrored repository descriptor

application/json

RestMirroredRepositoryDescriptor
GET/mirroring/latest/repos/{repoId}/mirrors
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/mirroring/latest/repos/{repoId}/mirrors' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 { "mirrorServer": { "enabled": true, "name": "Mirror", "id": "B0F5-CS21-45C2-CCK3", "lastSeenDate": "<string>", "mirrorType": "SINGLE", "productType": "Bitbucket", "productVersion": "8.0.0", "baseUrl": "http://vietnam.example.com" } }
GET

Get mirroring requests

Retrieves a mirroring request

Request

Query parameters

state

string

start

number

limit

number

Responses

A page of mirroring requests

application/json

object
GET/mirroring/latest/requests
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/mirroring/latest/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 { "values": [ { "id": 2154, "state": "PENDING", "mirrorName": "Bitbucket Mirror", "mirrorType": "SINGLE", "productType": "Bitbucket", "productVersion": "8.0.0", "mirrorId": "4f0eb5fc-67fc-48f8-b4a7-87981f026c6a", "mirrorBaseUrl": "https://bitbucket-eu.example.com:7990/bitbucket", "addonDescriptorUri": "https://bitbucket-eu.example.com:7990/bitbucket/rest/mirroring/1.0/descriptor" } ], "size": 1, "limit": 25, "start": 2154, "isLastPage": true, "nextPageStart": 2154 }
POST

Create a mirroring request

Creates a new mirroring request

Request

Request bodyapplication/json

state

string

mirrorName

string

mirrorType

string

productType

string

productVersion

string

mirrorId

string

mirrorBaseUrl

string

addonDescriptorUri

string

Responses

The created mirroring request

application/json

RestMirroringRequest
POST/mirroring/latest/requests
1 2 3 4 5 6 7 8 9 10 11 12 13 14 curl --request POST \ --url 'http://{baseurl}/rest/mirroring/latest/requests' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "state": "PENDING", "mirrorName": "Bitbucket Mirror", "mirrorType": "SINGLE", "productType": "Bitbucket", "productVersion": "8.0.0", "mirrorId": "4f0eb5fc-67fc-48f8-b4a7-87981f026c6a", "mirrorBaseUrl": "https://bitbucket-eu.example.com:7990/bitbucket", "addonDescriptorUri": "https://bitbucket-eu.example.com:7990/bitbucket/rest/mirroring/1.0/descriptor" }'
200Response
1 2 3 4 5 6 7 8 9 10 11 { "id": 2154, "state": "PENDING", "mirrorName": "Bitbucket Mirror", "mirrorType": "SINGLE", "productType": "Bitbucket", "productVersion": "8.0.0", "mirrorId": "4f0eb5fc-67fc-48f8-b4a7-87981f026c6a", "mirrorBaseUrl": "https://bitbucket-eu.example.com:7990/bitbucket", "addonDescriptorUri": "https://bitbucket-eu.example.com:7990/bitbucket/rest/mirroring/1.0/descriptor" }
GET

Get a mirroring request

Retrieves a mirroring request

Request

Path parameters

mirroringRequestId

string

Required

Responses

The mirroring request

application/json

RestMirroringRequest
GET/mirroring/latest/requests/{mirroringRequestId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/mirroring/latest/requests/{mirroringRequestId}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 { "id": 2154, "state": "PENDING", "mirrorName": "Bitbucket Mirror", "mirrorType": "SINGLE", "productType": "Bitbucket", "productVersion": "8.0.0", "mirrorId": "4f0eb5fc-67fc-48f8-b4a7-87981f026c6a", "mirrorBaseUrl": "https://bitbucket-eu.example.com:7990/bitbucket", "addonDescriptorUri": "https://bitbucket-eu.example.com:7990/bitbucket/rest/mirroring/1.0/descriptor" }
DEL

Delete a mirroring request

Deletes a mirroring request

Request

Path parameters

mirroringRequestId

string

Required

Responses

The request was deleted

DEL/mirroring/latest/requests/{mirroringRequestId}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/mirroring/latest/requests/{mirroringRequestId}'
POST

Accept a mirroring request

Accepts a mirroring request

Request

Path parameters

mirroringRequestId

string

Required

Responses

The accepted mirror server

application/json

RestMirrorServer
POST/mirroring/latest/requests/{mirroringRequestId}/accept
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/mirroring/latest/requests/{mirroringRequestId}/accept' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 { "enabled": true, "name": "Mirror", "id": "B0F5-CS21-45C2-CCK3", "lastSeenDate": "<string>", "mirrorType": "SINGLE", "productType": "Bitbucket", "productVersion": "8.0.0", "baseUrl": "http://vietnam.example.com" }
POST

Reject a mirroring request

Rejects a mirroring request

Request

Path parameters

mirroringRequestId

string

Required

Responses

The rejected mirror server

application/json

RestMirrorServer
POST/mirroring/latest/requests/{mirroringRequestId}/reject
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/mirroring/latest/requests/{mirroringRequestId}/reject' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 { "enabled": true, "name": "Mirror", "id": "B0F5-CS21-45C2-CCK3", "lastSeenDate": "<string>", "mirrorType": "SINGLE", "productType": "Bitbucket", "productVersion": "8.0.0", "baseUrl": "http://vietnam.example.com" }

Rate this page: