Get all access tokens associated with the given project.
string
Requirednumber
number
A response containing a page of access tokens and associated details.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/access-tokens/latest/projects/{projectKey}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"values": [
{
"createdDate": "<string>",
"name": "My access token",
"id": "252973515069"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Create an access token for the project according to the given request.
string
RequiredThe request containing the details of the access token to create.
integer
string
array<string>
A response containing the raw access token and associated details.
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"
]
}'
1
2
3
4
5
6
{
"token": "MjUyOTczNTE1MDY5On2rDbID2EgYpH8AVOECHv0saruQ",
"createdDate": "<string>",
"name": "My access token",
"id": "252973515069"
}
Get all access tokens associated with the given repository.
string
Requiredstring
Requirednumber
number
A response containing a page of access tokens and associated details.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/access-tokens/latest/projects/{projectKey}/repos/{repositorySlug}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"values": [
{
"createdDate": "<string>",
"name": "My access token",
"id": "252973515069"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Create an access token for the repository according to the given request.
string
Requiredstring
RequiredThe request containing the details of the access token to create.
integer
string
array<string>
A response containing the raw access token and associated details.
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"
]
}'
1
2
3
4
5
6
{
"token": "MjUyOTczNTE1MDY5On2rDbID2EgYpH8AVOECHv0saruQ",
"createdDate": "<string>",
"name": "My access token",
"id": "252973515069"
}
Get the access token identified by the given ID.
string
Requiredstring
Requiredstring
RequiredA response containing the access token and associated details.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/access-tokens/latest/projects/{projectKey}/repos/{repositorySlug}/{tokenId}' \
--header 'Accept: application/json'
1
2
3
4
5
{
"createdDate": "<string>",
"name": "My access token",
"id": "252973515069"
}
Modify an access token according to the given request. Any fields not specified will not be altered.
string
Requiredstring
Requiredstring
RequiredThe request containing the details of the access token to modify
integer
string
array<string>
A response containing the updated access token and associated details.
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"
]
}'
1
2
3
4
5
{
"createdDate": "<string>",
"name": "My access token",
"id": "252973515069"
}
Delete the access token identified by the given ID.
string
Requiredstring
Requiredstring
RequiredAn empty response indicating that the token has been deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/access-tokens/latest/projects/{projectKey}/repos/{repositorySlug}/{tokenId}'
Get the access token identified by the given ID.
string
Requiredstring
RequiredA response containing the access token and associated details.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/access-tokens/latest/projects/{projectKey}/{tokenId}' \
--header 'Accept: application/json'
1
2
3
4
5
{
"createdDate": "<string>",
"name": "My access token",
"id": "252973515069"
}
Modify an access token according to the given request. Any fields not specified will not be altered.
string
Requiredstring
RequiredThe request containing the details of the access token to modify
integer
string
array<string>
A response containing the updated access token and associated details.
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"
]
}'
1
2
3
4
5
{
"createdDate": "<string>",
"name": "My access token",
"id": "252973515069"
}
Delete the access token identified by the given ID.
string
Requiredstring
RequiredAn empty response indicating that the token has been deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/access-tokens/latest/projects/{projectKey}/{tokenId}'
Get all access tokens associated with the given user.
string
Requirednumber
number
A response containing a page of access tokens and associated details.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/access-tokens/latest/users/{userSlug}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"values": [
{
"createdDate": "<string>",
"name": "My access token",
"id": "252973515069"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Create an access token for the user according to the given request.
string
RequiredThe request containing the details of the access token to create.
integer
string
array<string>
A response containing the raw access token and associated details.
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"
]
}'
1
2
3
4
5
6
{
"token": "MjUyOTczNTE1MDY5On2rDbID2EgYpH8AVOECHv0saruQ",
"createdDate": "<string>",
"name": "My access token",
"id": "252973515069"
}
Get the access token identified by the given ID.
string
Requiredstring
RequiredA response containing the access token and associated details.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/access-tokens/latest/users/{userSlug}/{tokenId}' \
--header 'Accept: application/json'
1
2
3
4
5
{
"createdDate": "<string>",
"name": "My access token",
"id": "252973515069"
}
Modify an access token according to the given request. Any fields not specified will not be altered.
string
Requiredstring
RequiredThe request containing the details of the access token to modify
integer
string
array<string>
A response containing the updated access token and associated details.
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"
]
}'
1
2
3
4
5
{
"createdDate": "<string>",
"name": "My access token",
"id": "252973515069"
}
Delete the access token identified by the given ID.
string
Requiredstring
RequiredAn empty response indicating that the token has been deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/access-tokens/latest/users/{userSlug}/{tokenId}'
Retrieve a page of SSH keys.
string
string
number
number
A page of SSH keys.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/ssh/latest/keys' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"values": [
{
"lastAuthenticated": "1630041546434",
"algorithmType": "<string>",
"fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI",
"createdDate": "<string>",
"bitLength": 2154,
"expiryDays": 30,
"text": "ssh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1",
"id": 1
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Add a new SSH key to a supplied user.
RestSshKey
string
integer
integer
string
string
The newly created SSH key.
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"
}'
1
2
3
4
5
6
7
8
9
10
11
{
"lastAuthenticated": "1630041546434",
"algorithmType": "<string>",
"fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI",
"createdDate": "<string>",
"bitLength": 2154,
"expiryDays": 30,
"text": "ssh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1",
"id": 1
}
Delete all SSH keys for a supplied user.
string
string
The SSH keys matching the supplied user were deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/ssh/latest/keys'
Retrieve an SSH key by keyId
string
RequiredAn SSH key.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/ssh/latest/keys/{keyId}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
{
"lastAuthenticated": "1630041546434",
"algorithmType": "<string>",
"fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI",
"createdDate": "<string>",
"bitLength": 2154,
"expiryDays": 30,
"text": "ssh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1",
"id": 1
}
Delete an SSH key.
string
RequiredThe SSH key matching the supplied id was deleted or did not exist.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/ssh/latest/keys/{keyId}'
Gets the SSH settings from the upstream.
This request has no parameters.
The ssh settings from upstream
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/ssh/latest/settings' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
{
"baseUrl": "ssh://example.com",
"accessKeysEnabled": true,
"enabled": true,
"fingerprint": {
"algorithm": "<string>",
"value": "<string>"
},
"port": 7999
}
Updates the permission granted to the specified SSH key to the project identified in the URL.
string
Requiredstring
Requiredstring
RequiredThe newly created access key.
1
2
3
curl --request PUT \
--url 'http://{baseurl}/rest/keys/latest/projects/{projectKey}/ssh/{keyId}/permission/{permission}' \
--header 'Accept: application/json'
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
{
"repository": {
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"key": {
"lastAuthenticated": "1630041546434",
"algorithmType": "<string>",
"fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI",
"createdDate": "<string>",
"bitLength": 2154,
"expiryDays": 30,
"text": "ssh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1",
"id": 1
},
"permission": "USER_ADMIN"
}
Updates the permission granted to the specified SSH key to the repository identified in the URL.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe newly created access key.
1
2
3
curl --request PUT \
--url 'http://{baseurl}/rest/keys/latest/projects/{projectKey}/repos/{repositorySlug}/ssh/{keyId}/permission/{permission}' \
--header 'Accept: application/json'
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
{
"repository": {
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"key": {
"lastAuthenticated": "1630041546434",
"algorithmType": "<string>",
"fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI",
"createdDate": "<string>",
"bitLength": 2154,
"expiryDays": 30,
"text": "ssh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1",
"id": 1
},
"permission": "USER_ADMIN"
}
Retrieves the access key for the SSH key with id keyId
on the repository identified in the URL.
string
Requiredstring
Requiredstring
RequiredThe access key for the repository and SSH key with ID keyId
.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/keys/latest/projects/{projectKey}/repos/{repositorySlug}/ssh/{keyId}' \
--header 'Accept: application/json'
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
{
"repository": {
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"key": {
"lastAuthenticated": "1630041546434",
"algorithmType": "<string>",
"fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI",
"createdDate": "<string>",
"bitLength": 2154,
"expiryDays": 30,
"text": "ssh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1",
"id": 1
},
"permission": "USER_ADMIN"
}
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.
string
Requiredstring
Requiredstring
RequiredThe access key was deleted (or none was found matching the given id).
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/keys/latest/projects/{projectKey}/repos/{repositorySlug}/ssh/{keyId}'
Retrieves the access key for the SSH key with id keyId
on the project identified in the URL.
string
Requiredstring
RequiredThe access key for the repository and SSH key with ID keyId
.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/keys/latest/projects/{projectKey}/ssh/{keyId}' \
--header 'Accept: application/json'
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
{
"repository": {
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"key": {
"lastAuthenticated": "1630041546434",
"algorithmType": "<string>",
"fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI",
"createdDate": "<string>",
"bitLength": 2154,
"expiryDays": 30,
"text": "ssh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1",
"id": 1
},
"permission": "USER_ADMIN"
}
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.
string
Requiredstring
RequiredThe access key was deleted (or none was found matching the given id).
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/keys/latest/projects/{projectKey}/ssh/{keyId}'
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.
string
Requiredstring
The SSH key with ID keyId
.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/keys/latest/ssh/{keyId}/repos' \
--header 'Accept: application/json'
Retrieves the access keys for the project identified in the URL.
string
Requiredstring
string
number
number
A single page of access keys associated with the project.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/keys/latest/projects/{projectKey}/ssh' \
--header 'Accept: application/json'
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": [
{
"repository": {
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"key": {
"lastAuthenticated": "1630041546434",
"algorithmType": "<string>",
"fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI",
"createdDate": "<string>",
"bitLength": 2154,
"expiryDays": 30,
"text": "ssh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1",
"id": 1
},
"permission": "USER_ADMIN"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Register a new SSH key and grants access to the project identified in the URL.
string
Requiredobject
object
object
string
The newly created access key.
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 '{
"repository": {
"project": {
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
},
"scmId": "git",
"slug": "my-repo",
"name": "My repo",
"links": {}
},
"project": {
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
},
"key": {
"algorithmType": "<string>",
"bitLength": 2154,
"expiryDays": 30,
"text": "ssh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1"
},
"permission": "USER_ADMIN"
}'
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
{
"repository": {
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"key": {
"lastAuthenticated": "1630041546434",
"algorithmType": "<string>",
"fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI",
"createdDate": "<string>",
"bitLength": 2154,
"expiryDays": 30,
"text": "ssh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1",
"id": 1
},
"permission": "USER_ADMIN"
}
Retrieves the access keys for the repository identified in the URL.
string
Requiredstring
Requiredstring
string
string
string
number
number
A single page of access keys for the repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/keys/latest/projects/{projectKey}/repos/{repositorySlug}/ssh' \
--header 'Accept: application/json'
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": [
{
"repository": {
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"key": {
"lastAuthenticated": "1630041546434",
"algorithmType": "<string>",
"fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI",
"createdDate": "<string>",
"bitLength": 2154,
"expiryDays": 30,
"text": "ssh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1",
"id": 1
},
"permission": "USER_ADMIN"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Register a new SSH key and grants access to the repository identified in the URL.
string
Requiredstring
Requiredobject
object
object
string
The newly created access key.
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 '{
"repository": {
"project": {
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
},
"scmId": "git",
"slug": "my-repo",
"name": "My repo",
"links": {}
},
"project": {
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
},
"key": {
"algorithmType": "<string>",
"bitLength": 2154,
"expiryDays": 30,
"text": "ssh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1"
},
"permission": "USER_ADMIN"
}'
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
{
"repository": {
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"description": "My repo description",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true
},
"project": {
"namespace": "<string>",
"description": "The description for my cool project",
"avatar": "<string>",
"scope": "PROJECT",
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true
},
"key": {
"lastAuthenticated": "1630041546434",
"algorithmType": "<string>",
"fingerprint": "Cbg38r+gDCiNHqBk6Y1BKO+EvufFBqhFWIEXh8oq9MI",
"createdDate": "<string>",
"bitLength": 2154,
"expiryDays": 30,
"text": "ssh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1",
"id": 1
},
"permission": "USER_ADMIN"
}
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.
string
RequiredRestProject
RestRepository
The access keys were deleted (or none was found matching the given id and repositories or projects).
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": {
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
},
"repositories": {
"project": {
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
},
"scmId": "git",
"slug": "my-repo",
"name": "My repo",
"links": {}
}
}'
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.
integer
RequiredThe SSH key with ID keyId
.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/keys/latest/ssh/{keyId}/projects' \
--header 'Accept: application/json'
Rate this page: