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
Get SSH keys Retrieve all SSH keys for the authenticated user with pagination and search functionality.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
page | query | integer | no | Page number for pagination |
limit | query | integer | no | Number of records per page |
search | query | string | no | Search term to filter SSH keys by name |
include_deleted | query | boolean | no | Include soft-deleted SSH keys |
Response data field | Type | Description |
|---|---|---|
ssh_keys | UserSshKeyList[] | |
pagination | SshKeyPagination | |
search | SshKeySearch |
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
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 field | Type | Required | Description |
|---|---|---|---|
name | string | yes | SSH key name |
public_key | string | yes | SSH public key |
Response data field | Type | Description |
|---|---|---|
id | integer | SSH key ID |
user_id | integer | User ID |
name | string | SSH key name |
public_key | string | SSH public key |
fingerprint | string | SSH key fingerprint |
created_at | string (date-time) | Creation timestamp |
updated_at | string (date-time) | Last update timestamp |
deleted_at | string (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}
Get specific SSH key Retrieve details of a specific SSH key by ID for the authenticated user.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | yes | SSH key ID |
Response data: UserSshKey
Response data field | Type | Description |
|---|---|---|
id | integer | SSH key ID |
user_id | integer | User ID |
name | string | SSH key name |
public_key | string | SSH public key |
fingerprint | string | SSH key fingerprint |
created_at | string (date-time) | Creation timestamp |
updated_at | string (date-time) | Last update timestamp |
deleted_at | string (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}
Update SSH key Update an existing SSH key for the authenticated user. Can update name and public key.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | yes | SSH key ID |
Request body: SshKeyUpdateRequest (application/json) · Response data: UserSshKey
| Body field | Type | Required | Description |
|---|---|---|---|
name | string | no | SSH key name |
public_key | string | no | SSH public key |
Response data field | Type | Description |
|---|---|---|
id | integer | SSH key ID |
user_id | integer | User ID |
name | string | SSH key name |
public_key | string | SSH public key |
fingerprint | string | SSH key fingerprint |
created_at | string (date-time) | Creation timestamp |
updated_at | string (date-time) | Last update timestamp |
deleted_at | string (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}
Delete SSH key Soft delete an SSH key for the authenticated user. The key can be restored later.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | yes | SSH key ID |
Response data field | Type | Description |
|---|---|---|
message | string | Success 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
Restore SSH key Restore a soft-deleted SSH key for the authenticated user.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | yes | SSH key ID |
Response data: UserSshKey
Response data field | Type | Description |
|---|---|---|
id | integer | SSH key ID |
user_id | integer | User ID |
name | string | SSH key name |
public_key | string | SSH public key |
fingerprint | string | SSH key fingerprint |
created_at | string (date-time) | Creation timestamp |
updated_at | string (date-time) | Last update timestamp |
deleted_at | string (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
Hard delete SSH key Permanently delete an SSH key for the authenticated user. This action cannot be undone.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | yes | SSH key ID |
Response data field | Type | Description |
|---|---|---|
message | string | Success 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
Generate SSH key fingerprint Generate a fingerprint from an SSH public key for validation purposes.
Request body: SshKeyFingerprintRequest (application/json) · Response data: SshKeyFingerprintResponse
| Body field | Type | Required | Description |
|---|---|---|---|
public_key | string | yes | SSH public key to generate fingerprint for |
Response data field | Type | Description |
|---|---|---|
fingerprint | string | Generated fingerprint |
public_key | string | Original 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
Get SSH key activities Retrieve SSH key related activities for the authenticated user with pagination.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
page | query | integer | no | Page number for pagination |
limit | query | integer | no | Number of records per page |
Response data field | Type | Description |
|---|---|---|
activities | SshKeyActivity[] | |
pagination | SshKeyPagination |
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