POST/servers/hetzner

Create Hetzner Server

Create a new server on Hetzner and register it in Coolify. A cloud-init script or extra SSH key IDs need a token with the deploy permission.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

15 body fields

Hetzner server creation parameters

cloud_init_scriptstringoptional
Cloud-init YAML script (optional). Needs a token with the deploy permission.
cloud_provider_token_idstringdeprecatedoptional
Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.
cloud_provider_token_uuidstringoptional
Cloud provider token UUID. Required if cloud_provider_token_id is not provided.
enable_backupsbooleanoptional
Enable Hetzner server backups after creation (adds 20% to the monthly server fee)
enable_ipv4booleanoptional
Enable IPv4 (default: true)
enable_ipv6booleanoptional
Enable IPv6 (default: true)
hetzner_firewall_idsarray<integer>optional
Existing Hetzner firewall IDs to apply during server creation
hetzner_network_idsarray<integer>optional
Existing Hetzner network IDs to attach during server creation
hetzner_ssh_key_idsarray<integer>optional
Additional Hetzner SSH key IDs. Needs a token with the deploy permission.
imageintegerrequired
Hetzner image ID
instant_validatebooleanoptional
Validate server immediately after creation
locationstringrequired
Hetzner location name
namestringoptional
Server name (auto-generated if not provided)
private_key_uuidstringrequired
Private key UUID
server_typestringrequired
Hetzner server type name

7 status codes
201Hetzner server created.
hetzner_server_idintegeroptional
The Hetzner server ID.
ipstringoptional
The server IP address.
uuidstringoptional
The UUID of the server.
400Invalid token.
messagestringoptional
401Unauthenticated.
messagestringoptional
403The token needs the deploy permission for a cloud-init script or extra SSH keys.
404Resource not found.
messagestringoptional
422Validation error.
errorsobjectoptional
messagestringoptional
429Rate limit exceeded.
messagestringoptional

Error handling

A 400 is returned: Invalid token. A 401 is returned: Unauthenticated. A 403 is returned: The token needs the deploy permission for a cloud-init script or extra SSH keys. A 404 is returned: Resource not found. A 422 is returned: Validation error. A 429 is returned: Rate limit exceeded.