Coolify logoCoolify
POST
/servers/hetzner

Create a new server on Hetzner and register it in Coolify.

Authorization

bearerAuth
AuthorizationBearer <token>

Go to Keys & Tokens / API tokens and create a new token. Use the token as the bearer token.

In: header

Request Body

application/json

Hetzner server creation parameters

TypeScript Definitions

Use the request body type in TypeScript.

cloud_provider_token_uuid?string

Cloud provider token UUID. Required if cloud_provider_token_id is not provided.

cloud_provider_token_id?stringDeprecated

Deprecated: Use cloud_provider_token_uuid instead. Cloud provider token UUID.

location*string

Hetzner location name

server_type*string

Hetzner server type name

image*integer

Hetzner image ID

name?string

Server name (auto-generated if not provided)

private_key_uuid*string

Private key UUID

enable_ipv4?boolean

Enable IPv4 (default: true)

enable_ipv6?boolean

Enable IPv6 (default: true)

hetzner_ssh_key_ids?array<integer>

Additional Hetzner SSH key IDs

cloud_init_script?string

Cloud-init YAML script (optional)

instant_validate?boolean

Validate server immediately after creation

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://app.coolify.io/api/v1/servers/hetzner" \  -H "Content-Type: application/json" \  -d '{    "location": "nbg1",    "server_type": "cx11",    "image": 15512617,    "private_key_uuid": "xyz789"  }'
{  "uuid": "og888os",  "hetzner_server_id": 0,  "ip": "string"}
{  "message": "Invalid token."}
{  "message": "Unauthenticated."}
{  "message": "Resource not found."}
{  "message": "Validation error.",  "errors": {    "name": [      "The name field is required."    ],    "api_url": [      "The api url field is required.",      "The api url format is invalid."    ]  }}
{  "message": "Rate limit exceeded. Please try again later."}