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

Authentication

Postman Collection
OpenAPI
Operations
GET/access-tokens/latest/projects/{projectKey}PUT/access-tokens/latest/projects/{projectKey}GET/access-tokens/latest/projects/{projectKey}/repos/{repositorySlug}PUT/access-tokens/latest/projects/{projectKey}/repos/{repositorySlug}GET/access-tokens/latest/projects/{projectKey}/repos/{repositorySlug}/{tokenId}POST/access-tokens/latest/projects/{projectKey}/repos/{repositorySlug}/{tokenId}DEL/access-tokens/latest/projects/{projectKey}/repos/{repositorySlug}/{tokenId}GET/access-tokens/latest/projects/{projectKey}/{tokenId}POST/access-tokens/latest/projects/{projectKey}/{tokenId}DEL/access-tokens/latest/projects/{projectKey}/{tokenId}GET/access-tokens/latest/users/{userSlug}PUT/access-tokens/latest/users/{userSlug}GET/access-tokens/latest/users/{userSlug}/{tokenId}POST/access-tokens/latest/users/{userSlug}/{tokenId}DEL/access-tokens/latest/users/{userSlug}/{tokenId}GET/ssh/latest/settingsPUT/keys/latest/projects/{projectKey}/ssh/{keyId}/permission/{permission}PUT/keys/latest/projects/{projectKey}/repos/{repositorySlug}/ssh/{keyId}/permission/{permission}GET/keys/latest/projects/{projectKey}/sshPOST/keys/latest/projects/{projectKey}/sshGET/keys/latest/projects/{projectKey}/repos/{repositorySlug}/sshPOST/keys/latest/projects/{projectKey}/repos/{repositorySlug}/sshGET/keys/latest/projects/{projectKey}/repos/{repositorySlug}/ssh/{keyId}DEL/keys/latest/projects/{projectKey}/repos/{repositorySlug}/ssh/{keyId}GET/keys/latest/projects/{projectKey}/ssh/{keyId}DEL/keys/latest/projects/{projectKey}/ssh/{keyId}GET/keys/latest/ssh/{keyId}/projectsGET/keys/latest/ssh/{keyId}/reposDEL/keys/latest/ssh/{keyId}GET/ssh/latest/keysPOST/ssh/latest/keysDEL/ssh/latest/keysGET/ssh/latest/keys/{keyId}DEL/ssh/latest/keys/{keyId}
GET

Get project HTTP tokens

Get all access tokens associated with the given project.

Request

Path parameters

projectKey

string

Required

Query parameters

start

number

limit

number

Responses

A response containing a page of access tokens and associated details.

application/json

object
GET/access-tokens/latest/projects/{projectKey}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/access-tokens/latest/projects/{projectKey}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "values": [ { "id": "252973515069", "name": "My access token", "createdDate": "<string>" } ], "size": 1, "limit": 25, "nextPageStart": 2154, "isLastPage": true, "start": 2154 }
PUT

Create project HTTP token

Create an access token for the project according to the given request.

Request

Path parameters

projectKey

string

Required

Request bodyapplication/json

The request containing the details of the access token to create.

expiryDays

integer

name

string

permissions

array<string>

Responses

A response containing the raw access token and associated details.

application/json

RestRawAccessToken
PUT/access-tokens/latest/projects/{projectKey}
1 2 3 4 5 6 7 8 9 10 11 12 curl --request PUT \ --url 'http://{baseurl}/rest/access-tokens/latest/projects/{projectKey}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "expiryDays": 2154, "name": "My access token", "permissions": [ "REPO_ADMIN", "PROJECT_READ" ] }'
200Response
1 2 3 4 5 6 { "token": "MjUyOTczNTE1MDY5On2rDbID2EgYpH8AVOECHv0saruQ", "id": "252973515069", "name": "My access token", "createdDate": "<string>" }
GET

Get repository HTTP tokens

Get all access tokens associated with the given repository.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

start

number

limit

number

Responses

A response containing a page of access tokens and associated details.

application/json

object
GET/access-tokens/latest/projects/{projectKey}/repos/{repositorySlug}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/access-tokens/latest/projects/{projectKey}/repos/{repositorySlug}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "values": [ { "id": "252973515069", "name": "My access token", "createdDate": "<string>" } ], "size": 1, "limit": 25, "nextPageStart": 2154, "isLastPage": true, "start": 2154 }
PUT

Create repository HTTP token

Create an access token for the repository according to the given request.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The request containing the details of the access token to create.

expiryDays

integer

name

string

permissions

array<string>

Responses

A response containing the raw access token and associated details.

application/json

RestRawAccessToken
PUT/access-tokens/latest/projects/{projectKey}/repos/{repositorySlug}
1 2 3 4 5 6 7 8 9 10 11 12 curl --request PUT \ --url 'http://{baseurl}/rest/access-tokens/latest/projects/{projectKey}/repos/{repositorySlug}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "expiryDays": 2154, "name": "My access token", "permissions": [ "REPO_ADMIN", "PROJECT_READ" ] }'
200Response
1 2 3 4 5 6 { "token": "MjUyOTczNTE1MDY5On2rDbID2EgYpH8AVOECHv0saruQ", "id": "252973515069", "name": "My access token", "createdDate": "<string>" }
GET

Get HTTP token by ID

Get the access token identified by the given ID.

Request

Path parameters

projectKey

string

Required
tokenId

string

Required
repositorySlug

string

Required

Responses

A response containing the access token and associated details.

application/json

RestAccessToken
GET/access-tokens/latest/projects/{projectKey}/repos/{repositorySlug}/{tokenId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/access-tokens/latest/projects/{projectKey}/repos/{repositorySlug}/{tokenId}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 { "id": "252973515069", "name": "My access token", "createdDate": "<string>" }
POST

Update HTTP token

Modify an access token according to the given request. Any fields not specified will not be altered.

Request

Path parameters

projectKey

string

Required
tokenId

string

Required
repositorySlug

string

Required

Request bodyapplication/json

The request containing the details of the access token to modify

expiryDays

integer

name

string

permissions

array<string>

Responses

A response containing the updated access token and associated details.

application/json

RestAccessToken
POST/access-tokens/latest/projects/{projectKey}/repos/{repositorySlug}/{tokenId}
1 2 3 4 5 6 7 8 9 10 11 12 curl --request POST \ --url 'http://{baseurl}/rest/access-tokens/latest/projects/{projectKey}/repos/{repositorySlug}/{tokenId}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "expiryDays": 2154, "name": "My access token", "permissions": [ "REPO_ADMIN", "PROJECT_READ" ] }'
200Response
1 2 3 4 5 { "id": "252973515069", "name": "My access token", "createdDate": "<string>" }
DEL

Delete a HTTP token

Delete the access token identified by the given ID.

Request

Path parameters

projectKey

string

Required
tokenId

string

Required
repositorySlug

string

Required

Responses

An empty response indicating that the token has been deleted.

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

Get HTTP token by ID

Get the access token identified by the given ID.

Request

Path parameters

projectKey

string

Required
tokenId

string

Required

Responses

A response containing the access token and associated details.

application/json

RestAccessToken
GET/access-tokens/latest/projects/{projectKey}/{tokenId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/access-tokens/latest/projects/{projectKey}/{tokenId}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 { "id": "252973515069", "name": "My access token", "createdDate": "<string>" }
POST

Update HTTP token

Modify an access token according to the given request. Any fields not specified will not be altered.

Request

Path parameters

projectKey

string

Required
tokenId

string

Required

Request bodyapplication/json

The request containing the details of the access token to modify

expiryDays

integer

name

string

permissions

array<string>

Responses

A response containing the updated access token and associated details.

application/json

RestAccessToken
POST/access-tokens/latest/projects/{projectKey}/{tokenId}
1 2 3 4 5 6 7 8 9 10 11 12 curl --request POST \ --url 'http://{baseurl}/rest/access-tokens/latest/projects/{projectKey}/{tokenId}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "expiryDays": 2154, "name": "My access token", "permissions": [ "REPO_ADMIN", "PROJECT_READ" ] }'
200Response
1 2 3 4 5 { "id": "252973515069", "name": "My access token", "createdDate": "<string>" }
DEL

Delete a HTTP token

Delete the access token identified by the given ID.

Request

Path parameters

projectKey

string

Required
tokenId

string

Required

Responses

An empty response indicating that the token has been deleted.

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

Get personal HTTP tokens

Get all access tokens associated with the given user.

Request

Path parameters

userSlug

string

Required

Query parameters

start

number

limit

number

Responses

A response containing a page of access tokens and associated details.

application/json

object
GET/access-tokens/latest/users/{userSlug}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/access-tokens/latest/users/{userSlug}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "values": [ { "id": "252973515069", "name": "My access token", "createdDate": "<string>" } ], "size": 1, "limit": 25, "nextPageStart": 2154, "isLastPage": true, "start": 2154 }
PUT

Create personal HTTP token

Create an access token for the user according to the given request.

Request

Path parameters

userSlug

string

Required

Request bodyapplication/json

The request containing the details of the access token to create.

expiryDays

integer

name

string

permissions

array<string>

Responses

A response containing the raw access token and associated details.

application/json

RestRawAccessToken
PUT/access-tokens/latest/users/{userSlug}
1 2 3 4 5 6 7 8 9 10 11 12 curl --request PUT \ --url 'http://{baseurl}/rest/access-tokens/latest/users/{userSlug}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "expiryDays": 2154, "name": "My access token", "permissions": [ "REPO_ADMIN", "PROJECT_READ" ] }'
200Response
1 2 3 4 5 6 { "token": "MjUyOTczNTE1MDY5On2rDbID2EgYpH8AVOECHv0saruQ", "id": "252973515069", "name": "My access token", "createdDate": "<string>" }
GET

Get HTTP token by ID

Get the access token identified by the given ID.

Request

Path parameters

tokenId

string

Required
userSlug

string

Required

Responses

A response containing the access token and associated details.

application/json

RestAccessToken
GET/access-tokens/latest/users/{userSlug}/{tokenId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/access-tokens/latest/users/{userSlug}/{tokenId}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 { "id": "252973515069", "name": "My access token", "createdDate": "<string>" }
POST

Update HTTP token

Modify an access token according to the given request. Any fields not specified will not be altered.

Request

Path parameters

tokenId

string

Required
userSlug

string

Required

Request bodyapplication/json

The request containing the details of the access token to modify

expiryDays

integer

name

string

permissions

array<string>

Responses

A response containing the updated access token and associated details.

application/json

RestAccessToken
POST/access-tokens/latest/users/{userSlug}/{tokenId}
1 2 3 4 5 6 7 8 9 10 11 12 curl --request POST \ --url 'http://{baseurl}/rest/access-tokens/latest/users/{userSlug}/{tokenId}' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "expiryDays": 2154, "name": "My access token", "permissions": [ "REPO_ADMIN", "PROJECT_READ" ] }'
200Response
1 2 3 4 5 { "id": "252973515069", "name": "My access token", "createdDate": "<string>" }
DEL

Delete a HTTP token

Delete the access token identified by the given ID.

Request

Path parameters

tokenId

string

Required
userSlug

string

Required

Responses

An empty response indicating that the token has been deleted.

DEL/access-tokens/latest/users/{userSlug}/{tokenId}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/access-tokens/latest/users/{userSlug}/{tokenId}'
GET

Get SSH settings

Gets the SSH settings from the upstream.

Request

This request has no parameters.

Responses

The ssh settings from upstream

application/json

RestSshSettings
GET/ssh/latest/settings
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/ssh/latest/settings' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 { "port": 7999, "fingerprint": { "algorithm": "<string>", "value": "<string>" }, "accessKeysEnabled": true, "enabled": true, "baseUrl": "ssh://example.com" }
PUT

Update project SSH key permission

Updates the permission granted to the specified SSH key to the project identified in the URL.

Request

Path parameters

projectKey

string

Required
keyId

string

Required
permission

string

Required

Responses

The newly created access key.

application/json

RestSshAccessKey
PUT/keys/latest/projects/{projectKey}/ssh/{keyId}/permission/{permission}
1 2 3 curl --request PUT \ --url 'http://{baseurl}/rest/keys/latest/projects/{projectKey}/ssh/{keyId}/permission/{permission}' \ --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 { "permission": "USER_ADMIN", "key": { "id": 1, "createdDate": "<string>", "expiryDays": 30, "lastAuthenticated": "1630041546434", "fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI", "bitLength": 2154, "algorithmType": "<string>", "text": "ssh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }, "repository": { "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "description": "My repo description", "hierarchyId": "e3c939f9ef4a7fae272e", "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" }, "scope": "REPOSITORY", "origin": { "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "description": "My repo description", "hierarchyId": "e3c939f9ef4a7fae272e", "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" }, "scope": "REPOSITORY", "slug": "my-repo", "forkable": true, "archived": true, "scmId": "git" }, "slug": "my-repo", "forkable": true, "archived": true, "scmId": "git" }, "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" } }
PUT

Update repository SSH key permission

Updates the permission granted to the specified SSH key to the repository identified in the URL.

Request

Path parameters

projectKey

string

Required
keyId

string

Required
permission

string

Required
repositorySlug

string

Required

Responses

The newly created access key.

application/json

RestSshAccessKey
PUT/keys/latest/projects/{projectKey}/repos/{repositorySlug}/ssh/{keyId}/permission/{permission}
1 2 3 curl --request PUT \ --url 'http://{baseurl}/rest/keys/latest/projects/{projectKey}/repos/{repositorySlug}/ssh/{keyId}/permission/{permission}' \ --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 { "permission": "USER_ADMIN", "key": { "id": 1, "createdDate": "<string>", "expiryDays": 30, "lastAuthenticated": "1630041546434", "fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI", "bitLength": 2154, "algorithmType": "<string>", "text": "ssh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }, "repository": { "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "description": "My repo description", "hierarchyId": "e3c939f9ef4a7fae272e", "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" }, "scope": "REPOSITORY", "origin": { "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "description": "My repo description", "hierarchyId": "e3c939f9ef4a7fae272e", "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" }, "scope": "REPOSITORY", "slug": "my-repo", "forkable": true, "archived": true, "scmId": "git" }, "slug": "my-repo", "forkable": true, "archived": true, "scmId": "git" }, "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" } }
GET

Get SSH key

Retrieves the access keys for the project identified in the URL.

Request

Path parameters

projectKey

string

Required

Query parameters

filter

string

permission

string

start

number

limit

number

Responses

A single page of access keys associated with the project.

application/json

object
GET/keys/latest/projects/{projectKey}/ssh
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/keys/latest/projects/{projectKey}/ssh' \ --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 { "values": [ { "permission": "USER_ADMIN", "key": { "id": 1, "createdDate": "<string>", "expiryDays": 30, "lastAuthenticated": "1630041546434", "fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI", "bitLength": 2154, "algorithmType": "<string>", "text": "ssh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }, "repository": { "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "description": "My repo description", "hierarchyId": "e3c939f9ef4a7fae272e", "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" }, "scope": "REPOSITORY", "origin": { "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "description": "My repo description", "hierarchyId": "e3c939f9ef4a7fae272e", "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" }, "scope": "REPOSITORY", "slug": "my-repo", "forkable": true, "archived": true, "scmId": "git" }, "slug": "my-repo", "forkable": true, "archived": true, "scmId": "git" }, "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" } } ], "size": 1, "limit": 25, "nextPageStart": 2154, "isLastPage": true, "start": 2154 }
POST

Add project SSH key

Register a new SSH key and grants access to the project identified in the URL.

Request

Path parameters

projectKey

string

Required

Request bodyapplication/json

permission

string

key

object

repository

object

project

object

Responses

The newly created access key.

application/json

RestSshAccessKey
POST/keys/latest/projects/{projectKey}/ssh
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 curl --request POST \ --url 'http://{baseurl}/rest/keys/latest/projects/{projectKey}/ssh' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "permission": "USER_ADMIN", "key": { "expiryDays": 30, "bitLength": 2154, "algorithmType": "<string>", "text": "ssh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }, "repository": { "name": "My repo", "project": { "key": "PRJ", "avatarUrl": "<string>", "avatar": "<string>", "links": {} }, "slug": "my-repo", "scmId": "git", "links": {} }, "project": { "key": "PRJ", "avatarUrl": "<string>", "avatar": "<string>", "links": {} } }'
201Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 { "permission": "USER_ADMIN", "key": { "id": 1, "createdDate": "<string>", "expiryDays": 30, "lastAuthenticated": "1630041546434", "fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI", "bitLength": 2154, "algorithmType": "<string>", "text": "ssh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }, "repository": { "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "description": "My repo description", "hierarchyId": "e3c939f9ef4a7fae272e", "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" }, "scope": "REPOSITORY", "origin": { "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "description": "My repo description", "hierarchyId": "e3c939f9ef4a7fae272e", "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" }, "scope": "REPOSITORY", "slug": "my-repo", "forkable": true, "archived": true, "scmId": "git" }, "slug": "my-repo", "forkable": true, "archived": true, "scmId": "git" }, "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" } }
GET

Get repository SSH keys

Retrieves the access keys for the repository identified in the URL.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

filter

string

effective

string

minimumPermission

string

permission

string

start

number

limit

number

Responses

A single page of access keys for the repository.

application/json

object
GET/keys/latest/projects/{projectKey}/repos/{repositorySlug}/ssh
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/keys/latest/projects/{projectKey}/repos/{repositorySlug}/ssh' \ --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 { "values": [ { "permission": "USER_ADMIN", "key": { "id": 1, "createdDate": "<string>", "expiryDays": 30, "lastAuthenticated": "1630041546434", "fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI", "bitLength": 2154, "algorithmType": "<string>", "text": "ssh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }, "repository": { "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "description": "My repo description", "hierarchyId": "e3c939f9ef4a7fae272e", "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" }, "scope": "REPOSITORY", "origin": { "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "description": "My repo description", "hierarchyId": "e3c939f9ef4a7fae272e", "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" }, "scope": "REPOSITORY", "slug": "my-repo", "forkable": true, "archived": true, "scmId": "git" }, "slug": "my-repo", "forkable": true, "archived": true, "scmId": "git" }, "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" } } ], "size": 1, "limit": 25, "nextPageStart": 2154, "isLastPage": true, "start": 2154 }
POST

Add repository SSH key

Register a new SSH key and grants access to the repository identified in the URL.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/json

permission

string

key

object

repository

object

project

object

Responses

The newly created access key.

application/json

RestSshAccessKey
POST/keys/latest/projects/{projectKey}/repos/{repositorySlug}/ssh
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 curl --request POST \ --url 'http://{baseurl}/rest/keys/latest/projects/{projectKey}/repos/{repositorySlug}/ssh' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "permission": "USER_ADMIN", "key": { "expiryDays": 30, "bitLength": 2154, "algorithmType": "<string>", "text": "ssh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }, "repository": { "name": "My repo", "project": { "key": "PRJ", "avatarUrl": "<string>", "avatar": "<string>", "links": {} }, "slug": "my-repo", "scmId": "git", "links": {} }, "project": { "key": "PRJ", "avatarUrl": "<string>", "avatar": "<string>", "links": {} } }'
201Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 { "permission": "USER_ADMIN", "key": { "id": 1, "createdDate": "<string>", "expiryDays": 30, "lastAuthenticated": "1630041546434", "fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI", "bitLength": 2154, "algorithmType": "<string>", "text": "ssh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }, "repository": { "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "description": "My repo description", "hierarchyId": "e3c939f9ef4a7fae272e", "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" }, "scope": "REPOSITORY", "origin": { "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "description": "My repo description", "hierarchyId": "e3c939f9ef4a7fae272e", "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" }, "scope": "REPOSITORY", "slug": "my-repo", "forkable": true, "archived": true, "scmId": "git" }, "slug": "my-repo", "forkable": true, "archived": true, "scmId": "git" }, "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" } }
GET

Get repository SSH key

Retrieves the access key for the SSH key with id keyId on the repository identified in the URL.

Request

Path parameters

projectKey

string

Required
keyId

string

Required
repositorySlug

string

Required

Responses

The access key for the repository and SSH key with ID keyId.

application/json

RestSshAccessKey
GET/keys/latest/projects/{projectKey}/repos/{repositorySlug}/ssh/{keyId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/keys/latest/projects/{projectKey}/repos/{repositorySlug}/ssh/{keyId}' \ --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 { "permission": "USER_ADMIN", "key": { "id": 1, "createdDate": "<string>", "expiryDays": 30, "lastAuthenticated": "1630041546434", "fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI", "bitLength": 2154, "algorithmType": "<string>", "text": "ssh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }, "repository": { "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "description": "My repo description", "hierarchyId": "e3c939f9ef4a7fae272e", "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" }, "scope": "REPOSITORY", "origin": { "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "description": "My repo description", "hierarchyId": "e3c939f9ef4a7fae272e", "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" }, "scope": "REPOSITORY", "slug": "my-repo", "forkable": true, "archived": true, "scmId": "git" }, "slug": "my-repo", "forkable": true, "archived": true, "scmId": "git" }, "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" } }
DEL

Revoke repository SSH key

Remove an existing access key for the repository identified in the URL. If the same SSH key is used as an access key for multiple projects or repositories, only the access to the repository identified in the URL will be revoked.

Request

Path parameters

projectKey

string

Required
keyId

string

Required
repositorySlug

string

Required

Responses

The access key was deleted (or none was found matching the given id).

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

Get project SSH key

Retrieves the access key for the SSH key with id keyId on the project identified in the URL.

Request

Path parameters

projectKey

string

Required
keyId

string

Required

Responses

The access key for the repository and SSH key with ID keyId.

application/json

RestSshAccessKey
GET/keys/latest/projects/{projectKey}/ssh/{keyId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/keys/latest/projects/{projectKey}/ssh/{keyId}' \ --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 { "permission": "USER_ADMIN", "key": { "id": 1, "createdDate": "<string>", "expiryDays": 30, "lastAuthenticated": "1630041546434", "fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI", "bitLength": 2154, "algorithmType": "<string>", "text": "ssh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }, "repository": { "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "description": "My repo description", "hierarchyId": "e3c939f9ef4a7fae272e", "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" }, "scope": "REPOSITORY", "origin": { "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "statusMessage": "Available", "defaultBranch": "main", "relatedLinks": {}, "partition": 2154, "description": "My repo description", "hierarchyId": "e3c939f9ef4a7fae272e", "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" }, "scope": "REPOSITORY", "slug": "my-repo", "forkable": true, "archived": true, "scmId": "git" }, "slug": "my-repo", "forkable": true, "archived": true, "scmId": "git" }, "project": { "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT", "avatar": "<string>" } }
DEL

Revoke project SSH key

Remove an existing access key for the project identified in the URL. If the same SSH key is used as an access key for multiple projects or repositories, only the access to the project identified in the URL will be revoked.

Request

Path parameters

projectKey

string

Required
keyId

string

Required

Responses

The access key was deleted (or none was found matching the given id).

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

Get project SSH keys

Retrieves all project-related access keys for the SSH key with id keyId. If the current user is not an admin any of the projects the key provides access to, none are returned.

Request

Path parameters

keyId

integer

Required

Responses

The SSH key with ID keyId.

application/json

any

GET/keys/latest/ssh/{keyId}/projects
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/keys/latest/ssh/{keyId}/projects' \ --header 'Accept: application/json'
GET

Get repository SSH key

Retrieves all repository-related access keys for the SSH key with id keyId. If the current user is not an admin of any of the projects the key provides access to, none are returned.

Request

Path parameters

keyId

string

Required

Query parameters

withRestrictions

string

Responses

The SSH key with ID keyId.

application/json

any

GET/keys/latest/ssh/{keyId}/repos
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/keys/latest/ssh/{keyId}/repos' \ --header 'Accept: application/json'
DEL

Revoke project SSH key

Remove an existing access key for the projects and repositories in the submitted entity. If the same SSH key is used as an access key for multiple projects or repositories not supplied, only the access to the projects or repositories identified will be revoked.

Request

Path parameters

keyId

string

Required

Request bodyapplication/json

projects

RestProject

repositories

RestRepository

Responses

The access keys were deleted (or none was found matching the given id and repositories or projects).

DEL/keys/latest/ssh/{keyId}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 curl --request DELETE \ --url 'http://{baseurl}/rest/keys/latest/ssh/{keyId}' \ --header 'Content-Type: application/json' \ --data '{ "projects": { "key": "PRJ", "avatarUrl": "<string>", "avatar": "<string>", "links": {} }, "repositories": { "name": "My repo", "project": { "key": "PRJ", "avatarUrl": "<string>", "avatar": "<string>", "links": {} }, "slug": "my-repo", "scmId": "git", "links": {} } }'
GET

Get SSH keys for user

Retrieve a page of SSH keys.

Request

Query parameters

userName

string

user

string

start

number

limit

number

Responses

A page of SSH keys.

application/json

object
GET/ssh/latest/keys
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/ssh/latest/keys' \ --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": 1, "createdDate": "<string>", "expiryDays": 30, "lastAuthenticated": "1630041546434", "fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI", "bitLength": 2154, "algorithmType": "<string>", "text": "ssh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" } ], "size": 1, "limit": 25, "nextPageStart": 2154, "isLastPage": true, "start": 2154 }
POST

Add SSH key for user

Add a new SSH key to a supplied user.

Request

Query parameters

user

RestSshKey

Request bodyapplication/json

algorithmType

string

bitLength

integer

expiryDays

integer

label

string

text

string

Responses

The newly created SSH key.

application/json

RestSshKey
POST/ssh/latest/keys
1 2 3 4 5 6 7 8 9 10 11 curl --request POST \ --url 'http://{baseurl}/rest/ssh/latest/keys' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "algorithmType": "<string>", "bitLength": 2154, "expiryDays": 30, "label": "me@127.0.0.1", "text": "ssh-rsa AAAAB3... me@127.0.0.1" }'
201Response
1 2 3 4 5 6 7 8 9 10 11 { "id": 1, "createdDate": "<string>", "expiryDays": 30, "lastAuthenticated": "1630041546434", "fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI", "bitLength": 2154, "algorithmType": "<string>", "text": "ssh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }
DEL

Delete all user SSH key

Delete all SSH keys for a supplied user.

Request

Query parameters

userName

string

user

string

Responses

The SSH keys matching the supplied user were deleted.

DEL/ssh/latest/keys
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/ssh/latest/keys'
GET

Get SSH key for user by keyId

Retrieve an SSH key by keyId

Request

Path parameters

keyId

string

Required

Responses

An SSH key.

application/json

RestSshKey
GET/ssh/latest/keys/{keyId}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/ssh/latest/keys/{keyId}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 { "id": 1, "createdDate": "<string>", "expiryDays": 30, "lastAuthenticated": "1630041546434", "fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI", "bitLength": 2154, "algorithmType": "<string>", "text": "ssh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }
DEL

Remove SSH key

Delete an SSH key.

Request

Path parameters

keyId

string

Required

Responses

The SSH key matching the supplied id was deleted or did not exist.

DEL/ssh/latest/keys/{keyId}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/ssh/latest/keys/{keyId}'

Rate this page: