Create SSH key
Add a new SSH key to a server.
POST/api/servers/{server}/ssh-keys
Create a new SSH key
This endpoint allows you to add a new SSH key to a server.
Required attributes
- Name
name- Type
- string
- Description
The name of the SSH key. Maximum: 255 characters.
- Name
key- Type
- string
- Description
The SSH public key. Must be a valid SSH key format.
Optional attributes
- Name
system_user- Type
- string
- Description
The system user to associate with this SSH key. Must be a valid system user name.
Request
POST
/api/servers/{server}/ssh-keyscurl -X POST "https://ploi.io/api/servers/{server}/ssh-keys" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "New key",
"key": "ssh-rsa AAA...",
"system_user": "ploi"
}'
Response
{
"data": {
"id": 2,
"status": "created",
"name": "key",
"key": "ssh-rsa AAA....",
"system_user": "ploi"
}
}