API Reference
Complete API documentation for hcloud-js
API Reference
hcloud-js provides a typed client for all Hetzner Cloud API endpoints. All APIs are accessible through the HCloudClient instance.
Client Structure
const client = new HCloudClient({ token: 'your-token' });
// Available API clients:
client.servers // Servers API
client.images // Images API
client.actions // Actions API
client.certificates // Certificates API
client.sshKeys // SSH Keys API
client.locations // Locations API
client.firewalls // Firewalls API
client.floatingIPs // Floating IPs API
client.isos // ISOs API
client.placementGroups // Placement Groups API
client.primaryIPs // Primary IPs API
client.serverTypes // Server Types API
client.loadBalancers // Load Balancers API
client.networks // Networks API
client.pricing // Pricing API
client.volumes // Volumes API
client.dns // DNS (Zones) APICommon Patterns
Listing Resources
Most APIs support listing resources with optional filtering and pagination:
// List all servers
const servers = await client.servers.list();
// List with filters
const filtered = await client.servers.list({
name: 'my-server',
label_selector: 'environment=production',
sort: ['name:asc'],
page: 1,
per_page: 50
});Getting a Single Resource
const server = await client.servers.get(12345);
console.log(server.server.name);Creating Resources
const newServer = await client.servers.create({
name: 'my-server',
server_type: 'cpx11',
image: 'ubuntu-22.04',
location: 'nbg1'
});Updating Resources
const updated = await client.servers.update(12345, {
name: 'new-name',
labels: { environment: 'production' }
});Deleting Resources
await client.servers.delete(12345);Utilities
Utilities
Helper functions for pagination, action polling, type guards, and more
API Documentation
Servers API
Manage your Hetzner Cloud servers - includes all server actions
Images API
Work with server images and snapshots
Networks API
Manage private networks
Load Balancers API
Configure load balancers
DNS API
Manage DNS zones and records
All APIs
Complete list of all available APIs