ServerMania logo

Edit SSH Key

To edit an SSH key you may use both types of the following requests:

PUT /users/:user_id/ssh_keys/:id.xml
PUT /users/:user_id/ssh_keys/:id.json

or

PUT /settings/ssh_keys/:id.xml
PUT /settings/ssh_keys/:id.json

XML Request Example

curl -X POST -u user:userpass http://test/users/12/ssh_keys/3.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d'<ssh_key><key> ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAqzsLk+oPP9Qxz0Xgpqoe9DqNV7Qe3+oig/o6Ubt30Yh+Zarf8NXctqqeamC1KrlMt12d0AWd38dZ0CU6Eru/2ciwzz2IB0MLrTyjfLCNe2CW64uNjhSS1SH6gSjJUYwHSi7jUBl0vlGtJ7jswBdhgaKkjk1vXH3YFLTHPuKU+pc= user@test2</key></ssh_key>' 

JSON Request Example

curl -X POST -u user:userpass http://test/users/12/ssh_keys/3.json -H 'Accept: application/json' -H 'Content-type: application/json' -d'{"ssh_key":{"key":"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAqzsLk+oPP9Qxz0Xgpqoe9DqNV7Qe3+oig/o6Ubt30Yh+Zarf8NXctqqeamC1KrlMt12d0AWd38dZ0CU6Eru/2ciwzz2IB0MLrTyjfLCNe2CW64uNjhSS1SH6gSjJUYwHSi7jUBl0vlGtJ7jswBdhgaKkjk1vXH3YFLTHPuKU+pc= user@test2"}}'