API Reference
POST
ssh-keys/uploadUpload SSH Key
Upload SSH Key is a POST request to https://api.sharkcluster.com/ssh-keys/upload in the SSH Keys section of the SharkCluster API. Upload your existing public key. You can optionally provide a server_id to have the key automatically installed on a specific server. It takes 3 parameters, 2 required (name and public_key).
Request URL
POST
https://api.sharkcluster.com/ssh-keys/uploadHow do you call Upload SSH Key?
- 1Get a token from the login endpoint (POST /login) and send it as Authorization: Bearer <token>. See Login.
- 2Send a POST request to https://api.sharkcluster.com/ssh-keys/upload.
- 3Include the required parameters: name and public_key.
- 4Add the optional parameter only if you need it: server_id.
Request parameters
| Parameter | Type | Description |
|---|---|---|
nameRequired | string | Label for the key (e.g., "My Laptop"). |
public_keyRequired | string | The actual public key string (e.g., ssh-rsa ...). |
server_id | string | Optional: Install this key on a specific server immediately. |
AuthorizationRequired | header | Bearer token for authentication (e.g., Bearer eyJ...). |
What does Upload SSH Key return?
This endpoint has no documented response sample yet; check the response body of your first call.
Request sample
const axios = require('axios');
axios.post('https://api.sharkcluster.com/ssh-keys/upload', {
name: "Office PC",
public_key: "ssh-rsa AAAAB3Nza..."
}, { headers: { 'Authorization': 'Bearer YOUR_TOKEN' }})
.then(res => console.log(res.data));
Related SSH Keys endpoints
Stuck on an integration?
Raise a ticket from the panel with the endpoint and the response you got back — it reaches an engineer with your server already attached.