View .md

SSH Keys endpoints (Client API: account)

9 FeatherPanel Client API: account endpoints from user/ssh-keys.php: methods, paths, auth, permissions, rate limits, parameters and responses.

Last synced from FeatherPanel 15b94e9 on .

On this page

Defined in backend/app/routes/user/ssh-keys.php. Authentication used here: Signed-in user. Read Authentication for how to send credentials and Rate limits and errors for the response envelope.

Paths, methods, permissions and rate limits come from the route file. Summaries, parameters and response codes come from the OpenAPI annotations on the controllers; endpoints without annotations show only what the route file declares.

Endpoints

GET/api/user/ssh-keys

Auth: Signed-in userDefault rate limit: 30 / minute (user-ssh-keys)Route name: user-ssh-keysController: UserSshKeyController::getUserSshKeysroute source

Get SSH keys Retrieve all SSH keys for the authenticated user with pagination and search functionality.

ParameterInTypeRequiredDescription
pagequeryintegernoPage number for pagination
limitqueryintegernoNumber of records per page
searchquerystringnoSearch term to filter SSH keys by name
include_deletedquerybooleannoInclude soft-deleted SSH keys
Response data fieldTypeDescription
ssh_keysUserSshKeyList[]
paginationSshKeyPagination
searchSshKeySearch
curl -X GET "$PANEL_URL/api/user/ssh-keys" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Responses: 200 SSH keys retrieved successfully · 400 Bad request - Invalid authentication token · 401 Unauthorized - User not authenticated · 500 Internal server error - Failed to retrieve SSH keys

POST/api/user/ssh-keys

Auth: Signed-in userRoute name: user-ssh-key-createController: UserSshKeyController::createUserSshKeyroute source

Create SSH key Create a new SSH key for the authenticated user with automatic fingerprint generation.

Request body: SshKeyCreateRequest (application/json) · Response data: UserSshKey

Body fieldTypeRequiredDescription
namestringyesSSH key name
public_keystringyesSSH public key
Response data fieldTypeDescription
idintegerSSH key ID
user_idintegerUser ID
namestringSSH key name
public_keystringSSH public key
fingerprintstringSSH key fingerprint
created_atstring (date-time)Creation timestamp
updated_atstring (date-time)Last update timestamp
deleted_atstring (date-time)Deletion timestamp
curl -X POST "$PANEL_URL/api/user/ssh-keys" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"name":"","public_key":""}'

Plugin events: featherpanel:user:ssh_key:created

Responses: 201 SSH key created successfully · 400 Bad request - Invalid authentication token, missing required fields, or invalid name length · 401 Unauthorized - User not authenticated · 500 Internal server error - Failed to create SSH key

GET/api/user/ssh-keys/{id}

Auth: Signed-in userDefault rate limit: 30 / minute (user-ssh-keys)Route name: user-ssh-key-getController: UserSshKeyController::getUserSshKeyroute source

Get specific SSH key Retrieve details of a specific SSH key by ID for the authenticated user.

ParameterInTypeRequiredDescription
idpathintegeryesSSH key ID

Response data: UserSshKey

Response data fieldTypeDescription
idintegerSSH key ID
user_idintegerUser ID
namestringSSH key name
public_keystringSSH public key
fingerprintstringSSH key fingerprint
created_atstring (date-time)Creation timestamp
updated_atstring (date-time)Last update timestamp
deleted_atstring (date-time)Deletion timestamp
curl -X GET "$PANEL_URL/api/user/ssh-keys/$ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Responses: 200 SSH key retrieved successfully · 400 Bad request - Invalid authentication token or SSH key ID · 401 Unauthorized - User not authenticated · 403 Forbidden - Access denied to SSH key · 404 Not found - SSH key not found · 500 Internal server error - Failed to retrieve SSH key

PUT/api/user/ssh-keys/{id}

Auth: Signed-in userDefault rate limit: 10 / minute (user-ssh-keys)Route name: user-ssh-key-updateController: UserSshKeyController::updateUserSshKeyroute source

Update SSH key Update an existing SSH key for the authenticated user. Can update name and public key.

ParameterInTypeRequiredDescription
idpathintegeryesSSH key ID

Request body: SshKeyUpdateRequest (application/json) · Response data: UserSshKey

Body fieldTypeRequiredDescription
namestringnoSSH key name
public_keystringnoSSH public key
Response data fieldTypeDescription
idintegerSSH key ID
user_idintegerUser ID
namestringSSH key name
public_keystringSSH public key
fingerprintstringSSH key fingerprint
created_atstring (date-time)Creation timestamp
updated_atstring (date-time)Last update timestamp
deleted_atstring (date-time)Deletion timestamp
curl -X PUT "$PANEL_URL/api/user/ssh-keys/$ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"name":"","public_key":""}'

Plugin events: featherpanel:user:ssh_key:updated

Responses: 200 SSH key updated successfully · 400 Bad request - Invalid authentication token, SSH key ID, request data, or invalid name length · 401 Unauthorized - User not authenticated · 403 Forbidden - Access denied to SSH key · 404 Not found - SSH key not found · 500 Internal server error - Failed to update SSH key

DELETE/api/user/ssh-keys/{id}

Auth: Signed-in userDefault rate limit: 10 / minute (user-ssh-keys)Route name: user-ssh-key-deleteController: UserSshKeyController::deleteUserSshKeyroute source

Delete SSH key Soft delete an SSH key for the authenticated user. The key can be restored later.

ParameterInTypeRequiredDescription
idpathintegeryesSSH key ID
Response data fieldTypeDescription
messagestringSuccess message
curl -X DELETE "$PANEL_URL/api/user/ssh-keys/$ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Plugin events: featherpanel:user:ssh_key:deleted

Responses: 200 SSH key deleted successfully · 400 Bad request - Invalid authentication token or SSH key ID · 401 Unauthorized - User not authenticated · 403 Forbidden - Access denied to SSH key · 404 Not found - SSH key not found · 500 Internal server error - Failed to delete SSH key

POST/api/user/ssh-keys/{id}/restore

Auth: Signed-in userRoute name: user-ssh-key-restoreController: UserSshKeyController::restoreUserSshKeyroute source

Restore SSH key Restore a soft-deleted SSH key for the authenticated user.

ParameterInTypeRequiredDescription
idpathintegeryesSSH key ID

Response data: UserSshKey

Response data fieldTypeDescription
idintegerSSH key ID
user_idintegerUser ID
namestringSSH key name
public_keystringSSH public key
fingerprintstringSSH key fingerprint
created_atstring (date-time)Creation timestamp
updated_atstring (date-time)Last update timestamp
deleted_atstring (date-time)Deletion timestamp
curl -X POST "$PANEL_URL/api/user/ssh-keys/$ID/restore" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Plugin events: featherpanel:user:ssh_key:updated

Responses: 200 SSH key restored successfully · 400 Bad request - Invalid authentication token or SSH key ID · 401 Unauthorized - User not authenticated · 403 Forbidden - Access denied to SSH key · 404 Not found - SSH key not found · 500 Internal server error - Failed to restore SSH key

DELETE/api/user/ssh-keys/{id}/hard-delete

Auth: Signed-in userDefault rate limit: 5 / minute (user-ssh-keys)Route name: user-ssh-key-hard-deleteController: UserSshKeyController::hardDeleteUserSshKeyroute source

Hard delete SSH key Permanently delete an SSH key for the authenticated user. This action cannot be undone.

ParameterInTypeRequiredDescription
idpathintegeryesSSH key ID
Response data fieldTypeDescription
messagestringSuccess message
curl -X DELETE "$PANEL_URL/api/user/ssh-keys/$ID/hard-delete" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Plugin events: featherpanel:user:ssh_key:deleted

Responses: 200 SSH key permanently deleted successfully · 400 Bad request - Invalid authentication token or SSH key ID · 401 Unauthorized - User not authenticated · 403 Forbidden - Access denied to SSH key · 404 Not found - SSH key not found · 500 Internal server error - Failed to permanently delete SSH key

POST/api/user/ssh-keys/generate-fingerprint

Auth: Signed-in userRoute name: user-ssh-key-generate-fingerprintController: UserSshKeyController::generateFingerprintroute source

Generate SSH key fingerprint Generate a fingerprint from an SSH public key for validation purposes.

Request body: SshKeyFingerprintRequest (application/json) · Response data: SshKeyFingerprintResponse

Body fieldTypeRequiredDescription
public_keystringyesSSH public key to generate fingerprint for
Response data fieldTypeDescription
fingerprintstringGenerated fingerprint
public_keystringOriginal public key
curl -X POST "$PANEL_URL/api/user/ssh-keys/generate-fingerprint" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"public_key":""}'

Responses: 200 Fingerprint generated successfully · 400 Bad request - Invalid authentication token, missing public key, empty public key, or invalid SSH key format · 401 Unauthorized - User not authenticated · 500 Internal server error - Failed to generate fingerprint

GET/api/user/ssh-keys/activities

Auth: Signed-in userDefault rate limit: 30 / minute (user-ssh-keys)Route name: user-ssh-key-activitiesController: UserSshKeyController::getUserSshKeyActivitiesroute source

Get SSH key activities Retrieve SSH key related activities for the authenticated user with pagination.

ParameterInTypeRequiredDescription
pagequeryintegernoPage number for pagination
limitqueryintegernoNumber of records per page
Response data fieldTypeDescription
activitiesSshKeyActivity[]
paginationSshKeyPagination
curl -X GET "$PANEL_URL/api/user/ssh-keys/activities" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Responses: 200 SSH key activities retrieved successfully · 400 Bad request - Invalid authentication token · 401 Unauthorized - User not authenticated · 500 Internal server error - Failed to retrieve activities