API Reference
POSTssh-keys/upload

Upload 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

POSThttps://api.sharkcluster.com/ssh-keys/upload

How do you call Upload SSH Key?

  1. 1Get a token from the login endpoint (POST /login) and send it as Authorization: Bearer <token>. See Login.
  2. 2Send a POST request to https://api.sharkcluster.com/ssh-keys/upload.
  3. 3Include the required parameters: name and public_key.
  4. 4Add the optional parameter only if you need it: server_id.

Request parameters

ParameterTypeDescription
name
Required
stringLabel for the key (e.g., "My Laptop").
public_key
Required
stringThe actual public key string (e.g., ssh-rsa ...).
server_idstringOptional: Install this key on a specific server immediately.
Authorization
Required
headerBearer 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));

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.

Contact us