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
{
"values": [
{
"algorithmType": "<string>",
"bitLength": 2154,
"id": 1,
"text": "sh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Add a new ssh key to a supplied user.
RestSshKey
string
string
integer
string
The newly created ssh key.
1
2
3
4
5
6
7
8
9
curl --request POST \
--url 'http://{baseurl}/rest/ssh/latest/keys' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"algorithmType": "<string>",
"bitLength": 2154,
"text": "sh-rsa AAAAB3... me@127.0.0.1"
}'
1
2
3
4
5
6
7
{
"algorithmType": "<string>",
"bitLength": 2154,
"id": 1,
"text": "sh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.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'
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}'
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/ssh/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
{
"values": [
{
"key": {
"algorithmType": "<string>",
"bitLength": 2154,
"id": 1,
"text": "sh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1"
},
"permission": "USER_ADMIN",
"project": {
"avatar": "<string>",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL",
"description": "The description for my cool project",
"namespace": "<string>",
"scope": "PROJECT"
},
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Register a new SSH key and grants access to the repository identified in the URL.
string
Requiredstring
Requiredobject
string
object
object
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
curl --request POST \
--url 'http://{baseurl}/rest/ssh/latest/projects/{projectKey}/repos/{repositorySlug}/ssh' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"key": {
"algorithmType": "<string>",
"bitLength": 2154,
"text": "sh-rsa AAAAB3... me@127.0.0.1"
},
"permission": "USER_ADMIN",
"project": {
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
},
"repository": {
"scmId": "git",
"slug": "my-repo",
"name": "My repo",
"project": "PROJ",
"links": {}
}
}'
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
{
"key": {
"algorithmType": "<string>",
"bitLength": 2154,
"id": 1,
"text": "sh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1"
},
"permission": "USER_ADMIN",
"project": {
"avatar": "<string>",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL",
"description": "The description for my cool project",
"namespace": "<string>",
"scope": "PROJECT"
},
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
}
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/ssh/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
{
"key": {
"algorithmType": "<string>",
"bitLength": 2154,
"id": 1,
"text": "sh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1"
},
"permission": "USER_ADMIN",
"project": {
"avatar": "<string>",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL",
"description": "The description for my cool project",
"namespace": "<string>",
"scope": "PROJECT"
},
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
}
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/ssh/latest/projects/{projectKey}/repos/{repositorySlug}/ssh/{keyId}'
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/ssh/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
{
"key": {
"algorithmType": "<string>",
"bitLength": 2154,
"id": 1,
"text": "sh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1"
},
"permission": "USER_ADMIN",
"project": {
"avatar": "<string>",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL",
"description": "The description for my cool project",
"namespace": "<string>",
"scope": "PROJECT"
},
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
}
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/ssh/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
{
"values": [
{
"key": {
"algorithmType": "<string>",
"bitLength": 2154,
"id": 1,
"text": "sh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1"
},
"permission": "USER_ADMIN",
"project": {
"avatar": "<string>",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL",
"description": "The description for my cool project",
"namespace": "<string>",
"scope": "PROJECT"
},
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Register a new SSH key and grants access to the project identified in the URL.
string
Requiredobject
string
object
object
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
curl --request POST \
--url 'http://{baseurl}/rest/ssh/latest/projects/{projectKey}/ssh' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"key": {
"algorithmType": "<string>",
"bitLength": 2154,
"text": "sh-rsa AAAAB3... me@127.0.0.1"
},
"permission": "USER_ADMIN",
"project": {
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
},
"repository": {
"scmId": "git",
"slug": "my-repo",
"name": "My repo",
"project": "PROJ",
"links": {}
}
}'
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
{
"key": {
"algorithmType": "<string>",
"bitLength": 2154,
"id": 1,
"text": "sh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1"
},
"permission": "USER_ADMIN",
"project": {
"avatar": "<string>",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL",
"description": "The description for my cool project",
"namespace": "<string>",
"scope": "PROJECT"
},
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
}
Retrieves the access key for the SSH key with id keyId
on the repository 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/ssh/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
{
"key": {
"algorithmType": "<string>",
"bitLength": 2154,
"id": 1,
"text": "sh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1"
},
"permission": "USER_ADMIN",
"project": {
"avatar": "<string>",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL",
"description": "The description for my cool project",
"namespace": "<string>",
"scope": "PROJECT"
},
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
}
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/ssh/latest/projects/{projectKey}/ssh/{keyId}'
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/ssh/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
{
"key": {
"algorithmType": "<string>",
"bitLength": 2154,
"id": 1,
"text": "sh-rsa AAAAB3... me@127.0.0.1",
"label": "me@127.0.0.1"
},
"permission": "USER_ADMIN",
"project": {
"avatar": "<string>",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL",
"description": "The description for my cool project",
"namespace": "<string>",
"scope": "PROJECT"
},
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
}
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
{
"accessKeysEnabled": true,
"fingerprint": {
"algorithm": "<string>",
"value": "<string>"
},
"port": 7999,
"enabled": true,
"baseUrl": "ssh://example.com"
}
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
curl --request DELETE \
--url 'http://{baseurl}/rest/ssh/latest/ssh/{keyId}' \
--header 'Content-Type: application/json' \
--data '{
"projects": {
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
},
"repositories": {
"scmId": "git",
"slug": "my-repo",
"name": "My repo",
"project": "PROJ",
"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/ssh/latest/ssh/{keyId}/projects' \
--header 'Accept: application/json'
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
Requiredthe SSH key with ID keyId
.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/ssh/latest/ssh/{keyId}/repos' \
--header 'Accept: application/json'
Rate this page: