Skip to content

API Overview

Learn how to authenticate and interact with the SSH-KLM API using SDKs and direct API calls.

SSH-KLM uses JWT-based authentication with API keys.

  1. Navigate to Settings → API Keys
  2. Click Create API Key
  3. Set name and permissions
  4. Copy and securely store the key
import { QcClient } from '@qcecuring/ssh-sdk';
const client = new QcClient({
apiKey: process.env.QC_API_KEY,
baseUrl: 'https://ssh-klm.example.com' // Optional, defaults to cloud
});
Token TypeLifetimeRefresh
API KeyLong-livedManual rotation
Access Token15 minutesAuto-refresh
Refresh Token7 daysRe-authenticate
Terminal window
npm install @qcecuring/ssh-sdk
Terminal window
pip install qcecuring-ssh
Terminal window
go get github.com/qcecuring/ssh-sdk-go
import { QcClient } from '@qcecuring/ssh-sdk';
const client = new QcClient({ apiKey: process.env.QC_API_KEY });
// List all discovered keys
const keys = await client.ssh.listKeys();
// Start discovery scan
const scan = await client.ssh.startDiscovery({
hosts: ['server01.example.com']
});
// Request ephemeral access
const ephemeral = await client.ssh.requestEphemeral({
host: 'server01.example.com',
username: 'deploy',
ttl: 300
});
ResourceDescription
hostsTarget servers in inventory
keysDiscovered SSH keys
scansDiscovery scan jobs
rotationsKey rotation jobs
policiesRotation and access policies
ephemeralJust-in-time credentials
EndpointRate Limit
Read operations1000/minute
Write operations100/minute
Discovery scans10/minute
Ephemeral requests50/minute
import { QcClient, QcError } from '@qcecuring/ssh-sdk';
try {
await client.ssh.rotateKey({ keyId: 'invalid' });
} catch (error) {
if (error instanceof QcError) {
console.log('Error code:', error.code);
console.log('Message:', error.message);
console.log('Details:', error.details);
}
}
CodeDescription
AUTH_INVALIDInvalid or expired API key
AUTH_FORBIDDENInsufficient permissions
NOT_FOUNDResource not found
RATE_LIMITEDToo many requests
VALIDATION_ERRORInvalid request parameters