Add an SSH key
curl --request POST \
--url https://my.server.express/api/v1/user/ssh-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"publicKey": "<string>",
"name": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({publicKey: '<string>', name: '<string>'})
};
fetch('https://my.server.express/api/v1/user/ssh-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/user/ssh-keys"
payload = {
"publicKey": "<string>",
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"keyType": "ssh-ed25519",
"fingerprint": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"lastUsedAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}SSH Keys
Add an SSH key
Parses and validates an OpenSSH public key (ssh-ed25519, [email protected], ssh-rsa, ecdsa-sha2-nistp256/384/521, [email protected]; DSA refused). Parse errors come back verbatim as 400. Max 50 keys per account and no duplicate fingerprints (409). Name defaults to the key comment, then its type. Writes an ADD_SSH_KEY audit entry.
POST
/
v1
/
user
/
ssh-keys
Add an SSH key
curl --request POST \
--url https://my.server.express/api/v1/user/ssh-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"publicKey": "<string>",
"name": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({publicKey: '<string>', name: '<string>'})
};
fetch('https://my.server.express/api/v1/user/ssh-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/user/ssh-keys"
payload = {
"publicKey": "<string>",
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"keyType": "ssh-ed25519",
"fingerprint": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"lastUsedAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Authorizations
Session access token (JWT) from POST /v1/auth/login or /v1/auth/refresh. A session satisfies every API scope.
Body
application/json