post
/v1/keypairsCreate keypair
Create a new SSH keypair. If `public_key` is provided, it will be imported. If not provided, a new keypair will be generated and the private key returned.
Request Body
requiredContent-Type: application/json
name
stringrequiredpublic_key
stringoptionalSSH public key (if not provided, a new keypair will be generated)
type
stringoptionalEnum: "ssh", "x509"
Default: "ssh"
Responses
201
Keypair created
Content-Type: application/json
keypair
objectoptional400
Invalid request parameters
Content-Type: application/json
error
objectrequired401
Authentication required or token invalid
Content-Type: application/json
error
objectrequired409
Resource conflict (e.g., already exists, invalid state)
Content-Type: application/json
error
objectrequired500
Internal server error
Content-Type: application/json
error
objectrequiredcurl -X POST "https://api.spo1.mycloud.com/v1/keypairs" \-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \-H "Content-Type: application/json" \-d '{"name": "my-keypair","public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAB...","type": "ssh"}'