Security Settings. – WordPress.com Developer Resources">Security Settings. – WordPress.com Developer Resources">Security Settings. – WordPress.com Developer Resources">Security Settings. – WordPress.com Developer Resources"> Skip to content

POST /wpcom/v2/sites/$wpcom_site/hosting/ssh-keys

Attach a new SSH key to a site. Before using it, you will want to add your "default" SSH key at Security Settings.

Resource Information

   
Method POST
URL https://public-api.wordpress.com/wpcom/v2/sites/$wpcom_site/hosting/ssh-keys
Requires authentication? Yes

Method Parameters

Parameter Type Required Description
wpcom_site string | integer Yes A domain or blog ID.
name string Yes Name of the SSH key we want to attach. Currently only "default" is supported.

Response Example

					
						{
    "name": "default",
    "user_login": "username",
    "sha256": "SHA256:1YqqmA7gif1Clf0NTwp96IYMh2pM+sVUDbk2sssqkPs",
    "type": "ssh-rsa",
    "attached_at": "2024-06-05T18:49:35+00:00"
}					
				

Resource Errors

This endpoint does not return any errors.