integrations.sh
← all integrations

Hetzner Cloud API

OpenAPI apis-guru hosting

This is the official API documentation for the Public Hetzner Cloud.

Introduction

The Hetzner Cloud API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses.

As an alternative to working directly with our API you may also consider to use:

  • Our CLI program
  • Our
  • Our

Also you can find a .

If you are developing integrations based on our API and your product is Open Source you may be eligible for a free one time €50 (excl. VAT) credit on your account. Please contact us via the the support page on your Cloud Console and let us know the following:

  • The type of integration you would like to develop
  • Link to the GitHub repo you will use for the Project
  • Link to some other Open Source work you have already done (if you have done so)

Getting Started

To get started using the API you first need an API token. Sign in into the choose a Project, go to SecurityAPI Tokens, and generate a new token. Make sure to copy the token because it won’t be shown to you again. A token is bound to a Project, to interact with the API of another Project you have to create a new token inside the Project. Let’s say your new token is jEheVytlAoFl7F8MqUQ7jAo2hOXASztX.

You’re now ready to do your first request against the API. To get a list of all Servers in your Project, issue the example request on the right side using .

Make sure to replace the token in the example command with the token you have just created. Since your Project probably does not contain any Servers yet, the example response will look like the response on the right side. We will almost always provide a resource root like servers inside the example response. A response can also contain a meta object with information like .

Example Request

bash
curl -H "Authorization: Bearer jEheVytlAoFl7F8MqUQ7jAo2hOXASztX" \    https://api.hetzner.cloud/v1/servers

Example Response

json
{    "servers": [],    "meta": {        "pagination": {            "page": 1,            "per_page": 25,            "previous_page": null,            "next_page": null,            "last_page": 1,            "total_entries": 0        }    }}

Authentication

All requests to the Hetzner Cloud API must be authenticated via a API token. Include your secret API token in every request you send to the API with the Authorization HTTP header.

To create a new API token for your Project, switch into the choose a Project, go to SecurityAPI Tokens, and generate a new token.

Example Authorization header

html
Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj

Errors

Errors are indicated by HTTP status codes. Further, the response of the request which generated the error contains an error code, an error message, and, optionally, error details. The schema of the error details object depends on the error code.

The error response contains the following keys:

KeysMeaning
codeShort string indicating the type of error (machine-parsable)
messageTextual description on what has gone wrong
detailsAn object providing for details on the error (schema depends on code)

Example response

json
{  "error": {    "code": "invalid_input",    "message": "invalid input in field 'broken_field': is too long",    "details": {      "fields": [        {          "name": "broken_field",          "messages": ["is too long"]        }      ]    }  }}

Error Codes

CodeDescription
forbiddenInsufficient permissions for this request
invalid_inputError while parsing or processing the input
json_errorInvalid JSON input in your request
lockedThe item you are trying to access is locked (there is already an Action running)
not_foundEntity not found
rate_limit_exceededError when sending too many requests
resource_limit_exceededError when exceeding the maximum quantity of a resource for an account
resource_unavailableThe requested resource is currently unavailable
service_errorError within a service
uniqueness_errorOne or more of the objects fields must be unique
protectedThe Action you are trying to start is protected for this resource
maintenanceCannot perform operation due to maintenance
conflictThe resource has changed during the request, please retry
unsupported_errorThe corresponding resource does not support the Action
token_readonlyThe token is only allowed to perform GET requests
unavailableA service or product is currently not available

invalid_input

json
{  "error": {    "code": "invalid_input",    "message": "invalid input in field 'broken_field': is too long",    "details": {      "fields": [        {          "name": "broken_field",          "messages": ["is too long"]        }      ]    }  }}

uniqueness_error

json
{  "error": {    "code": "uniqueness_error",    "message": "SSH key with the same fingerprint already exists",    "details": {      "fields": [        {          "name": "public_key"        }      ]    }  }}

resource_limit_exceeded

json
{  "error": {    "code": "resource_limit_exceeded",    "message": "project limit exceeded",    "details": {      "limits": [        {          "name": "project_limit"        }      ]    }  }}

Labels

Labels are key/value pairs that can be attached to all resources.

Valid label keys have two segments: an optional prefix and name, separated by a slash (/). The name segment is required and must be a string of 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between. The prefix is optional. If specified, the prefix must be a DNS subdomain: a series of DNS labels separated by dots (.), not longer than 253 characters in total, followed by a slash (/).

Valid label values must be a string of 63 characters or less and must be empty or begin and end with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between.

The hetzner.cloud/ prefix is reserved and cannot be used.

Example Labels

json
{  "labels": {    "environment":"development",    "service":"backend",    "example.com/my":"label",    "just-a-key":""  }}

Label Selector

For resources with labels, you can filter resources by their labels using the label selector query language.

ExpressionMeaning
k==v / k=vValue of key k does equal value v
k!=vValue of key k does not equal value v
kKey k is present
!kKey k is not present
k in (v1,v2,v3)Value of key k is v1, v2, or v3
k notin (v1,v2,v3)Value of key k is neither v1, nor v2, nor v3
k1==v,!k2Value of key k1 is v and key k2 is not present

Examples

  • Returns all resources that have a env=production label and that don't have a type=database label:

    env=production,type!=database

  • Returns all resources that have a env=testing or env=staging label:

    env in (testing,staging)

  • Returns all resources that don't have a type label:

    !type

Pagination

Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters:

  • A page parameter specifies the page to fetch. The number of the first page is 1.
  • A per_page parameter specifies the number of items returned per page. The default value is 25, the maximum value is 50 except otherwise specified in the documentation.

Responses contain a Link header with pagination information.

Additionally, if the response body is JSON and the root object is an object, that object has a pagination object inside the meta object with pagination information:

Example Pagination

json
{    "servers": [...],    "meta": {        "pagination": {            "page": 2,            "per_page": 25,            "previous_page": 1,            "next_page": 3,            "last_page": 4,            "total_entries": 100        }    }}

The keys previous_page, next_page, last_page, and total_entries may be null when on the first page, last page, or when the total number of entries is unknown.

Example Pagination Link header

bash
Link: <https://api.hetzner.cloud/v1/actions?page=2&per_page=5>; rel="prev",      <https://api.hetzner.cloud/v1/actions?page=4&per_page=5>; rel="next",      <https://api.hetzner.cloud/v1/actions?page=6&per_page=5>; rel="last"

Line breaks have been added for display purposes only and responses may only contain some of the above rel values.

Rate Limiting

All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled with a 429 Too Many Requests error. Burst requests are allowed. Responses contain serveral headers which provide information about your current rate limit status.

  • The RateLimit-Limit header contains the total number of requests you can perform per hour.
  • The RateLimit-Remaining header contains the number of requests remaining in the current rate limit time frame.
  • The RateLimit-Reset header contains a UNIX timestamp of the point in time when your rate limit will have recovered and you will have the full number of requests available again.

The default limit is 3600 requests per hour and per Project. The number of remaining requests increases gradually. For example, when your limit is 3600 requests per hour, the number of remaining requests will increase by 1 every second.

Server Metadata

Your Server can discover metadata about itself by doing a HTTP request to specific URLs. The following data is available:

DataFormatContents
hostnametextName of the Server as set in the api
instance-idnumberID of the server
public-ipv4textPrimary public IPv4 address
private-networksyamlDetails about the private networks the Server is attached to
availability-zonetextName of the availability zone that Server runs in
regiontextNetwork zone, e.g. eu-central

Example: Summary

bash
$ curl http://169.254.169.254/hetzner/v1/metadata
yaml
availability-zone: hel1-dc2hostname: my-serverinstance-id: 42public-ipv4: 1.2.3.4region: eu-central

Example: Hostname

bash
$ curl http://169.254.169.254/hetzner/v1/metadata/hostnamemy-server

Example: Instance ID

bash
$ curl http://169.254.169.254/hetzner/v1/metadata/instance-id42

Example: Public IPv4

bash
$ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv41.2.3.4

Example: Private Networks

bash
$ curl http://169.254.169.254/hetzner/v1/metadata/private-networks
json
- ip: 10.0.0.2  alias_ips: [10.0.0.3, 10.0.0.4]  interface_num: 1  mac_address: 86:00:00:2a:7d:e0  network_id: 1234  network_name: nw-test1  network: 10.0.0.0/8  subnet: 10.0.0.0/24  gateway: 10.0.0.1- ip: 192.168.0.2  alias_ips: []  interface_num: 2  mac_address: 86:00:00:2a:7d:e1  network_id: 4321  network_name: nw-test2  network: 192.168.0.0/16  subnet: 192.168.0.0/24  gateway: 192.168.0.1

Example: Availability Zone

bash
$ curl http://169.254.169.254/hetzner/v1/metadata/availability-zonehel1-dc2

Example: Region

bash
$ curl http://169.254.169.254/hetzner/v1/metadata/regioneu-central

Sorting

Some responses which return multiple items support sorting. If they do support sorting the documentation states which fields can be used for sorting. You specify sorting with the sort query string parameter. You can sort by multiple fields. You can set the sort direction by appending :asc or :desc to the field name. By default, ascending sorting is used.

Example: Sorting

bash
https://api.hetzner.cloud/v1/actions?sort=statushttps://api.hetzner.cloud/v1/actions?sort=status:aschttps://api.hetzner.cloud/v1/actions?sort=status:deschttps://api.hetzner.cloud/v1/actions?sort=status:asc&sort=command:desc
Homepage
https://api.apis.guru/v2/specs/hetzner.cloud/1.0.0.json
Provider
hetzner.cloud
OpenAPI version
3.0.0
Spec (JSON)
https://api.apis.guru/v2/specs/hetzner.cloud/1.0.0/openapi.json
Spec (YAML)
https://api.apis.guru/v2/specs/hetzner.cloud/1.0.0/openapi.yaml

Tools (146)

Extracted live via the executor SDK.

  • actions.getActions

    Returns all Action objects. You can sort the results by using the sort URI parameter, and filter them with the status parameter.

  • actions.getActionsId

    Returns a specific Action object.

  • certificateActions.getCertificatesIdActions

    Returns all Action objects for a Certificate. You can sort the results by using the sort URI parameter, and filter them with the status parameter.

    Only type managed Certificates can have Actions. For type uploaded Certificates the actions key will always contain an empty array.

  • certificateActions.getCertificatesIdActionsActionId

    Returns a specific Action for a Certificate. Only type managed Certificates have Actions.

  • certificateActions.postCertificatesIdActionsRetry

    Retry a failed Certificate issuance or renewal.

    Only applicable if the type of the Certificate is managed and the issuance or renewal status is failed.

    Call specific error codes

    CodeDescription
    caa_record_does_not_allow_caCAA record does not allow certificate authority
    ca_dns_validation_failedCertificate Authority: DNS validation failed
    ca_too_many_authorizations_failed_recentlyCertificate Authority: Too many authorizations failed recently
    ca_too_many_certificates_issued_for_registered_domainCertificate Authority: Too many certificates issued for registered domain
    ca_too_many_duplicate_certificatesCertificate Authority: Too many duplicate certificates
    could_not_verify_domain_delegated_to_zoneCould not verify domain delegated to zone
    dns_zone_not_foundDNS zone not found
    dns_zone_is_secondary_zoneDNS zone is a secondary zone
  • certificates.deleteCertificatesId

    Deletes a Certificate.

  • certificates.getCertificates

    Returns all Certificate objects.

  • certificates.getCertificatesId

    Gets a specific Certificate object.

  • certificates.postCertificates

    Creates a new Certificate.

    The default type uploaded allows for uploading your existing certificate and private_key in PEM format. You have to monitor its expiration date and handle renewal yourself.

    In contrast, type managed requests a new Certificate from Let's Encrypt for the specified domain_names. Only domains managed by Hetzner DNS are supported. We handle renewal and timely alert the project owner via email if problems occur.

    For type managed Certificates the action key of the response contains the Action that allows for tracking the issuance process. For type uploaded Certificates the action is always null.

  • certificates.putCertificatesId

    Updates the Certificate properties.

    Note that when updating labels, the Certificate’s current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body.

    Note: if the Certificate object changes during the request, the response will be a “conflict” error.

  • datacenters.getDatacenters

    Returns all Datacenter objects.

  • datacenters.getDatacentersId

    Returns a specific Datacenter object.

  • firewallActions.getFirewallsIdActions

    Returns all Action objects for a Firewall. You can sort the results by using the sort URI parameter, and filter them with the status parameter.

  • firewallActions.getFirewallsIdActionsActionId

    Returns a specific Action for a Firewall.

  • firewallActions.postFirewallsIdActionsApplyToResources

    Applies one Firewall to multiple resources.

    Currently servers (public network interface) and label selectors are supported.

    Call specific error codes

    CodeDescription
    firewall_already_appliedFirewall was already applied on resource
    incompatible_network_typeThe Network type is incompatible for the given resource
    firewall_resource_not_foundThe resource the Firewall should be attached to was not found
  • firewallActions.postFirewallsIdActionsRemoveFromResources

    Removes one Firewall from multiple resources.

    Currently only Servers (and their public network interfaces) are supported.

    Call specific error codes

    CodeDescription
    firewall_already_removedFirewall was already removed from the resource
    firewall_resource_not_foundThe resource the Firewall should be attached to was not found
    firewall_managed_by_label_selectorFirewall was applied via label selector and cannot be removed manually
  • firewallActions.postFirewallsIdActionsSetRules

    Sets the rules of a Firewall.

    All existing rules will be overwritten. Pass an empty rules array to remove all rules. The maximum amount of rules that can be defined is 50.

    Call specific error codes

    CodeDescription
    firewall_resource_not_foundThe resource the Firewall should be attached to was not found
  • firewalls.deleteFirewallsId

    Deletes a Firewall.

    Call specific error codes

    CodeDescription
    resource_in_useFirewall must not be in use to be deleted
  • firewalls.getFirewalls

    Returns all Firewall objects.

  • firewalls.getFirewallsId

    Gets a specific Firewall object.

  • firewalls.postFirewalls

    Creates a new Firewall.

    Call specific error codes

    CodeDescription
    server_already_addedServer added more than one time to resource
    incompatible_network_typeThe Network type is incompatible for the given resource
    firewall_resource_not_foundThe resource the Firewall should be attached to was not found
  • firewalls.putFirewallsId

    Updates the Firewall.

    Note that when updating labels, the Firewall's current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body.

    Note: if the Firewall object changes during the request, the response will be a “conflict” error.

  • floatingIpActions.getFloatingIpsIdActions

    Returns all Action objects for a Floating IP. You can sort the results by using the sort URI parameter, and filter them with the status parameter.

  • floatingIpActions.getFloatingIpsIdActionsActionId

    Returns a specific Action object for a Floating IP.

  • floatingIpActions.postFloatingIpsIdActionsAssign

    Assigns a Floating IP to a Server.

  • floatingIpActions.postFloatingIpsIdActionsChangeDnsPtr

    Changes the hostname that will appear when getting the hostname belonging to this Floating IP.

  • floatingIpActions.postFloatingIpsIdActionsChangeProtection

    Changes the protection configuration of the Floating IP.

  • floatingIpActions.postFloatingIpsIdActionsUnassign

    Unassigns a Floating IP, resulting in it being unreachable. You may assign it to a Server again at a later time.

  • floatingIPs.deleteFloatingIpsId

    Deletes a Floating IP. If it is currently assigned to a Server it will automatically get unassigned.

  • floatingIPs.getFloatingIps

    Returns all Floating IP objects.

  • floatingIPs.getFloatingIpsId

    Returns a specific Floating IP object.

  • floatingIPs.postFloatingIps

    Creates a new Floating IP assigned to a Server. If you want to create a Floating IP that is not bound to a Server, you need to provide the home_location key instead of server. This can be either the ID or the name of the Location this IP shall be created in. Note that a Floating IP can be assigned to a Server in any Location later on. For optimal routing it is advised to use the Floating IP in the same Location it was created in.

  • floatingIPs.putFloatingIpsId

    Updates the description or labels of a Floating IP. Also note that when updating labels, the Floating IP’s current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body.

  • imageActions.getImagesIdActions

    Returns all Action objects for an Image. You can sort the results by using the sort URI parameter, and filter them with the status parameter.

  • imageActions.getImagesIdActionsActionId

    Returns a specific Action for an Image.

  • imageActions.postImagesIdActionsChangeProtection

    Changes the protection configuration of the Image. Can only be used on snapshots.

  • images.deleteImagesId

    Deletes an Image. Only Images of type snapshot and backup can be deleted.

  • images.getImages

    Returns all Image objects. You can select specific Image types only and sort the results by using URI parameters.

  • images.getImagesId

    Returns a specific Image object.

  • images.putImagesId

    Updates the Image. You may change the description, convert a Backup Image to a Snapshot Image or change the Image labels. Only Images of type snapshot and backup can be updated.

    Note that when updating labels, the current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body.

  • isOs.getIsos

    Returns all available ISO objects.

  • isOs.getIsosId

    Returns a specific ISO object.

  • loadBalancerActions.getLoadBalancersIdActions

    Returns all Action objects for a Load Balancer. You can sort the results by using the sort URI parameter, and filter them with the status parameter.

  • loadBalancerActions.getLoadBalancersIdActionsActionId

    Returns a specific Action for a Load Balancer.

  • loadBalancerActions.postLoadBalancersIdActionsAddService

    Adds a service to a Load Balancer.

    Call specific error codes

    CodeDescription
    source_port_already_usedThe source port you are trying to add is already in use
  • loadBalancerActions.postLoadBalancersIdActionsAddTarget

    Adds a target to a Load Balancer.

    Call specific error codes

    CodeDescription
    cloud_resource_ip_not_allowedThe IP you are trying to add as a target belongs to a Hetzner Cloud resource
    ip_not_ownedThe IP you are trying to add as a target is not owned by the Project owner
    load_balancer_not_attached_to_networkThe Load Balancer is not attached to a network
    robot_unavailableRobot was not available. The caller may retry the operation after a short delay.
    server_not_attached_to_networkThe server you are trying to add as a target is not attached to the same network as the Load Balancer
    target_already_definedThe Load Balancer target you are trying to define is already defined
  • loadBalancerActions.postLoadBalancersIdActionsAttachToNetwork

    Attach a Load Balancer to a Network.

    Call specific error codes

    CodeDescription
    load_balancer_already_attachedThe Load Balancer is already attached to a network
    ip_not_availableThe provided Network IP is not available
    no_subnet_availableNo Subnet or IP is available for the Load Balancer within the network
  • loadBalancerActions.postLoadBalancersIdActionsChangeAlgorithm

    Change the algorithm that determines to which target new requests are sent.

  • loadBalancerActions.postLoadBalancersIdActionsChangeDnsPtr

    Changes the hostname that will appear when getting the hostname belonging to the public IPs (IPv4 and IPv6) of this Load Balancer.

    Floating IPs assigned to the Server are not affected by this.

  • loadBalancerActions.postLoadBalancersIdActionsChangeProtection

    Changes the protection configuration of a Load Balancer.

  • loadBalancerActions.postLoadBalancersIdActionsChangeType

    Changes the type (Max Services, Max Targets and Max Connections) of a Load Balancer.

    Call specific error codes

    CodeDescription
    invalid_load_balancer_typeThe Load Balancer type does not fit for the given Load Balancer
  • loadBalancerActions.postLoadBalancersIdActionsDeleteService

    Delete a service of a Load Balancer.

  • loadBalancerActions.postLoadBalancersIdActionsDetachFromNetwork

    Detaches a Load Balancer from a network.

  • loadBalancerActions.postLoadBalancersIdActionsDisablePublicInterface

    Disable the public interface of a Load Balancer. The Load Balancer will be not accessible from the internet via its public IPs.

    Call specific error codes

    CodeDescription
    load_balancer_not_attached_to_networkThe Load Balancer is not attached to a network
    targets_without_use_private_ipThe Load Balancer has targets that use the public IP instead of the private IP
  • loadBalancerActions.postLoadBalancersIdActionsEnablePublicInterface

    Enable the public interface of a Load Balancer. The Load Balancer will be accessible from the internet via its public IPs.

  • loadBalancerActions.postLoadBalancersIdActionsRemoveTarget

    Removes a target from a Load Balancer.

  • loadBalancerActions.postLoadBalancersIdActionsUpdateService

    Updates a Load Balancer Service.

    Call specific error codes

    CodeDescription
    source_port_already_usedThe source port you are trying to add is already in use
  • loadBalancers.deleteLoadBalancersId

    Deletes a Load Balancer.

  • loadBalancers.getLoadBalancers

    Gets all existing Load Balancers that you have available.

  • loadBalancers.getLoadBalancersId

    Gets a specific Load Balancer object.

  • loadBalancers.getLoadBalancersIdMetrics

    You must specify the type of metric to get: open_connections, connections_per_second, requests_per_second or bandwidth. You can also specify more than one type by comma separation, e.g. requests_per_second,bandwidth.

    Depending on the type you will get different time series data:

    TypeTimeseriesUnitDescription
    open_connectionsopen_connectionsnumberOpen connections
    connections_per_secondconnections_per_secondconnections/sConnections per second
    requests_per_secondrequests_per_secondrequests/sRequests per second
    bandwidthbandwidth.inbytes/sIngress bandwidth
    bandwidth.outbytes/sEgress bandwidth

    Metrics are available for the last 30 days only.

    If you do not provide the step argument we will automatically adjust it so that 200 samples are returned.

    We limit the number of samples to a maximum of 500 and will adjust the step parameter accordingly.

  • loadBalancers.postLoadBalancers

    Creates a Load Balancer.

    Call specific error codes

    CodeDescription
    cloud_resource_ip_not_allowedThe IP you are trying to add as a target belongs to a Hetzner Cloud resource
    ip_not_ownedThe IP is not owned by the owner of the project of the Load Balancer
    load_balancer_not_attached_to_networkThe Load Balancer is not attached to a network
    robot_unavailableRobot was not available. The caller may retry the operation after a short delay.
    server_not_attached_to_networkThe server you are trying to add as a target is not attached to the same network as the Load Balancer
    source_port_already_usedThe source port you are trying to add is already in use
    target_already_definedThe Load Balancer target you are trying to define is already defined
  • loadBalancers.putLoadBalancersId

    Updates a Load Balancer. You can update a Load Balancer’s name and a Load Balancer’s labels.

    Note that when updating labels, the Load Balancer’s current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body.

    Note: if the Load Balancer object changes during the request, the response will be a “conflict” error.

  • loadBalancerTypes.getLoadBalancerTypes

    Gets all Load Balancer type objects.

  • loadBalancerTypes.getLoadBalancerTypesId

    Gets a specific Load Balancer type object.

  • locations.getLocations

    Returns all Location objects.

  • locations.getLocationsId

    Returns a specific Location object.

  • networkActions.getNetworksIdActions

    Returns all Action objects for a Network. You can sort the results by using the sort URI parameter, and filter them with the status parameter.

  • networkActions.getNetworksIdActionsActionId

    Returns a specific Action for a Network.

  • networkActions.postNetworksIdActionsAddRoute

    Adds a route entry to a Network.

    Note: if the Network object changes during the request, the response will be a “conflict” error.

  • networkActions.postNetworksIdActionsAddSubnet

    Adds a new subnet object to the Network. If you do not specify an ip_range for the subnet we will automatically pick the first available /24 range for you if possible.

    Note: if the parent Network object changes during the request, the response will be a “conflict” error.

  • networkActions.postNetworksIdActionsChangeIpRange

    Changes the IP range of a Network. IP ranges can only be extended and never shrunk. You can only add IPs at the end of an existing IP range. This means that the IP part of your existing range must stay the same and you can only change its netmask.

    For example if you have a range 10.0.0.0/16 you want to extend then your new range must also start with the IP 10.0.0.0. Your CIDR netmask /16 may change to a number that is smaller than 16 thereby increasing the IP range. So valid entries would be 10.0.0.0/15, 10.0.0.0/14, 10.0.0.0/13 and so on.

    After changing the IP range you will have to adjust the routes on your connected Servers by either rebooting them or manually changing the routes to your private Network interface.

    Note: if the Network object changes during the request, the response will be a “conflict” error.

  • networkActions.postNetworksIdActionsChangeProtection

    Changes the protection configuration of a Network.

    Note: if the Network object changes during the request, the response will be a “conflict” error.

  • networkActions.postNetworksIdActionsDeleteRoute

    Delete a route entry from a Network.

    Note: if the Network object changes during the request, the response will be a “conflict” error.

  • networkActions.postNetworksIdActionsDeleteSubnet

    Deletes a single subnet entry from a Network. You cannot delete subnets which still have Servers attached. If you have Servers attached you first need to detach all Servers that use IPs from this subnet before you can delete the subnet.

    Note: if the Network object changes during the request, the response will be a “conflict” error.

  • networks.deleteNetworksId

    Deletes a network. If there are Servers attached they will be detached in the background.

    Note: if the network object changes during the request, the response will be a “conflict” error.

  • networks.getNetworks

    Gets all existing networks that you have available.

  • networks.getNetworksId

    Gets a specific network object.

  • networks.postNetworks

    Creates a network with the specified ip_range.

    You may specify one or more subnets. You can also add more Subnets later by using the . If you do not specify an ip_range in the subnet we will automatically pick the first available /24 range for you.

    You may specify one or more routes in routes. You can also add more routes later by using the .

  • networks.putNetworksId

    Updates the network properties.

    Note that when updating labels, the network’s current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body.

    Note: if the network object changes during the request, the response will be a “conflict” error.

  • placementGroups.deletePlacementGroupsId

    Deletes a PlacementGroup.

  • placementGroups.getPlacementGroups

    Returns all PlacementGroup objects.

  • placementGroups.getPlacementGroupsId

    Gets a specific PlacementGroup object.

  • placementGroups.postPlacementGroups

    Creates a new PlacementGroup.

  • placementGroups.putPlacementGroupsId

    Updates the PlacementGroup properties.

    Note that when updating labels, the PlacementGroup’s current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body.

    Note: if the PlacementGroup object changes during the request, the response will be a “conflict” error.

  • pricing.getPricing

    Returns prices for all resources available on the platform. VAT and currency of the Project owner are used for calculations.

    Both net and gross prices are included in the response.

  • primaryIpActions.postPrimaryIpsIdActionsAssign

    Assigns a Primary IP to a Server.

    A Server can only have one Primary IP of type ipv4 and one of type ipv6 assigned. If you need more IPs use Floating IPs.

    The Server must be powered off (status off) in order for this operation to succeed.

    Call specific error codes

    CodeDescription
    server_not_stoppedThe server is running, but needs to be powered off
    primary_ip_already_assignedPrimary ip is already assigned to a different server
    server_has_ipv4The server already has an ipv4 address
    server_has_ipv6The server already has an ipv6 address
  • primaryIpActions.postPrimaryIpsIdActionsChangeDnsPtr

    Changes the hostname that will appear when getting the hostname belonging to this Primary IP.

  • primaryIpActions.postPrimaryIpsIdActionsChangeProtection

    Changes the protection configuration of a Primary IP.

    A Primary IP can only be delete protected if its auto_delete property is set to false.

  • primaryIpActions.postPrimaryIpsIdActionsUnassign

    Unassigns a Primary IP from a Server.

    The Server must be powered off (status off) in order for this operation to succeed.

    Note that only Servers that have at least one network interface (public or private) attached can be powered on.

    Call specific error codes

    CodeDescription
    server_not_stoppedThe server is running, but needs to be powered off
    server_is_load_balancer_targetThe server ipv4 address is a loadbalancer target
  • primaryIPs.deletePrimaryIpsId

    Deletes a Primary IP.

    The Primary IP may be assigned to a Server. In this case it is unassigned automatically. The Server must be powered off (status off) in order for this operation to succeed.

  • primaryIPs.getPrimaryIps

    Returns all Primary IP objects.

  • primaryIPs.getPrimaryIpsId

    Returns a specific Primary IP object.

  • primaryIPs.postPrimaryIps

    Creates a new Primary IP, optionally assigned to a Server.

    If you want to create a Primary IP that is not assigned to a Server, you need to provide the datacenter key instead of assignee_id. This can be either the ID or the name of the Datacenter this Primary IP shall be created in.

    Note that a Primary IP can only be assigned to a Server in the same Datacenter later on.

    Call specific error codes

    CodeDescription
    server_not_stoppedThe specified server is running, but needs to be powered off
    server_has_ipv4The server already has an ipv4 address
    server_has_ipv6The server already has an ipv6 address
  • primaryIPs.putPrimaryIpsId

    Updates the Primary IP.

    Note that when updating labels, the Primary IP's current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body.

    If the Primary IP object changes during the request, the response will be a “conflict” error.

  • serverActions.getServersIdActions

    Returns all Action objects for a Server. You can sort the results by using the sort URI parameter, and filter them with the status parameter.

  • serverActions.getServersIdActionsActionId

    Returns a specific Action object for a Server.

  • serverActions.postServersIdActionsAddToPlacementGroup

    Adds a Server to a Placement Group.

    Server must be powered off for this command to succeed.

    Call specific error codes

    CodeDescription
    server_not_stoppedThe action requires a stopped server
  • serverActions.postServersIdActionsAttachIso

    Attaches an ISO to a Server. The Server will immediately see it as a new disk. An already attached ISO will automatically be detached before the new ISO is attached.

    Servers with attached ISOs have a modified boot order: They will try to boot from the ISO first before falling back to hard disk.

  • serverActions.postServersIdActionsAttachToNetwork

    Attaches a Server to a network. This will complement the fixed public Server interface by adding an additional ethernet interface to the Server which is connected to the specified network.

    The Server will get an IP auto assigned from a subnet of type server in the same network_zone.

    Using the alias_ips attribute you can also define one or more additional IPs to the Servers. Please note that you will have to configure these IPs by hand on your Server since only the primary IP will be given out by DHCP.

    Call specific error codes

    CodeDescription
    server_already_attachedThe server is already attached to the network
    ip_not_availableThe provided Network IP is not available
    no_subnet_availableNo Subnet or IP is available for the Server within the network
    networks_overlapThe network IP range overlaps with one of the server networks
  • serverActions.postServersIdActionsChangeAliasIps

    Changes the alias IPs of an already attached Network. Note that the existing aliases for the specified Network will be replaced with these provided in the request body. So if you want to add an alias IP, you have to provide the existing ones from the Network plus the new alias IP in the request body.

  • serverActions.postServersIdActionsChangeDnsPtr

    Changes the hostname that will appear when getting the hostname belonging to the primary IPs (IPv4 and IPv6) of this Server.

    Floating IPs assigned to the Server are not affected by this.

  • serverActions.postServersIdActionsChangeProtection

    Changes the protection configuration of the Server.

  • serverActions.postServersIdActionsChangeType

    Changes the type (Cores, RAM and disk sizes) of a Server.

    Server must be powered off for this command to succeed.

    This copies the content of its disk, and starts it again.

    You can only migrate to Server types with the same storage_type and equal or bigger disks. Shrinking disks is not possible as it might destroy data.

    If the disk gets upgraded, the Server type can not be downgraded any more. If you plan to downgrade the Server type, set upgrade_disk to false.

    Call specific error codes

    CodeDescription
    invalid_server_typeThe server type does not fit for the given server or is deprecated
    server_not_stoppedThe action requires a stopped server
  • serverActions.postServersIdActionsCreateImage

    Creates an Image (snapshot) from a Server by copying the contents of its disks. This creates a snapshot of the current state of the disk and copies it into an Image. If the Server is currently running you must make sure that its disk content is consistent. Otherwise, the created Image may not be readable.

    To make sure disk content is consistent, we recommend to shut down the Server prior to creating an Image.

    You can either create a backup Image that is bound to the Server and therefore will be deleted when the Server is deleted, or you can create an snapshot Image which is completely independent of the Server it was created from and will survive Server deletion. Backup Images are only available when the backup option is enabled for the Server. Snapshot Images are billed on a per GB basis.

  • serverActions.postServersIdActionsDetachFromNetwork

    Detaches a Server from a network. The interface for this network will vanish.

  • serverActions.postServersIdActionsDetachIso

    Detaches an ISO from a Server. In case no ISO Image is attached to the Server, the status of the returned Action is immediately set to success

  • serverActions.postServersIdActionsDisableBackup

    Disables the automatic backup option and deletes all existing Backups for a Server. No more additional charges for backups will be made.

    Caution: This immediately removes all existing backups for the Server!

  • serverActions.postServersIdActionsDisableRescue

    Disables the Hetzner Rescue System for a Server. This makes a Server start from its disks on next reboot.

    Rescue Mode is automatically disabled when you first boot into it or if you do not use it for 60 minutes.

    Disabling rescue mode will not reboot your Server — you will have to do this yourself.

  • serverActions.postServersIdActionsEnableBackup

    Enables and configures the automatic daily backup option for the Server. Enabling automatic backups will increase the price of the Server by 20%. In return, you will get seven slots where Images of type backup can be stored.

    Backups are automatically created daily.

  • serverActions.postServersIdActionsEnableRescue

    Enable the Hetzner Rescue System for this Server. The next time a Server with enabled rescue mode boots it will start a special minimal Linux distribution designed for repair and reinstall.

    In case a Server cannot boot on its own you can use this to access a Server’s disks.

    Rescue Mode is automatically disabled when you first boot into it or if you do not use it for 60 minutes.

    Enabling rescue mode will not your Server — you will have to do this yourself.

  • serverActions.postServersIdActionsPoweroff

    Cuts power to the Server. This forcefully stops it without giving the Server operating system time to gracefully stop. May lead to data loss, equivalent to pulling the power cord. Power off should only be used when shutdown does not work.

  • serverActions.postServersIdActionsPoweron

    Starts a Server by turning its power on.

  • serverActions.postServersIdActionsReboot

    Reboots a Server gracefully by sending an ACPI request. The Server operating system must support ACPI and react to the request, otherwise the Server will not reboot.

  • serverActions.postServersIdActionsRebuild

    Rebuilds a Server overwriting its disk with the content of an Image, thereby destroying all data on the target Server

    The Image can either be one you have created earlier (backup or snapshot Image) or it can be a completely fresh system Image provided by us. You can get a list of all available Images with GET /images.

    Your Server will automatically be powered off before the rebuild command executes.

  • serverActions.postServersIdActionsRemoveFromPlacementGroup

    Removes a Server from a Placement Group.

  • serverActions.postServersIdActionsRequestConsole

    Requests credentials for remote access via VNC over websocket to keyboard, monitor, and mouse for a Server. The provided URL is valid for 1 minute, after this period a new url needs to be created to connect to the Server. How long the connection is open after the initial connect is not subject to this timeout.

  • serverActions.postServersIdActionsReset

    Cuts power to a Server and starts it again. This forcefully stops it without giving the Server operating system time to gracefully stop. This may lead to data loss, it’s equivalent to pulling the power cord and plugging it in again. Reset should only be used when reboot does not work.

  • serverActions.postServersIdActionsResetPassword

    Resets the root password. Only works for Linux systems that are running the qemu guest agent. Server must be powered on (status running) in order for this operation to succeed.

    This will generate a new password for this Server and return it.

    If this does not succeed you can use the rescue system to netboot the Server and manually change your Server password by hand.

  • serverActions.postServersIdActionsShutdown

    Shuts down a Server gracefully by sending an ACPI shutdown request. The Server operating system must support ACPI and react to the request, otherwise the Server will not shut down.

  • servers.deleteServersId

    Deletes a Server. This immediately removes the Server from your account, and it is no longer accessible.

  • servers.getServers

    Returns all existing Server objects

  • servers.getServersId

    Returns a specific Server object. The Server must exist inside the Project

  • servers.getServersIdMetrics

    Get Metrics for specified Server.

    You must specify the type of metric to get: cpu, disk or network. You can also specify more than one type by comma separation, e.g. cpu,disk.

    Depending on the type you will get different time series data

    TypeTimeseriesUnitDescription
    cpucpupercentPercent CPU usage
    diskdisk.0.iops.readiop/sNumber of read IO operations per second
    disk.0.iops.writeiop/sNumber of write IO operations per second
    disk.0.bandwidth.readbytes/sBytes read per second
    disk.0.bandwidth.writebytes/sBytes written per second
    networknetwork.0.pps.inpackets/sPublic Network interface packets per second received
    network.0.pps.outpackets/sPublic Network interface packets per second sent
    network.0.bandwidth.inbytes/sPublic Network interface bytes/s received
    network.0.bandwidth.outbytes/sPublic Network interface bytes/s sent

    Metrics are available for the last 30 days only.

    If you do not provide the step argument we will automatically adjust it so that a maximum of 200 samples are returned.

    We limit the number of samples returned to a maximum of 500 and will adjust the step parameter accordingly.

  • servers.postServers

    Creates a new Server. Returns preliminary information about the Server as well as an Action that covers progress of creation.

  • servers.putServersId

    Updates a Server. You can update a Server’s name and a Server’s labels. Please note that Server names must be unique per Project and valid hostnames as per RFC 1123 (i.e. may only contain letters, digits, periods, and dashes). Also note that when updating labels, the Server’s current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body.

  • serverTypes.getServerTypes

    Gets all Server type objects.

  • serverTypes.getServerTypesId

    Gets a specific Server type object.

  • sshKeys.deleteSshKeysId

    Deletes an SSH key. It cannot be used anymore.

  • sshKeys.getSshKeys

    Returns all SSH key objects.

  • sshKeys.getSshKeysId

    Returns a specific SSH key object.

  • sshKeys.postSshKeys

    Creates a new SSH key with the given name and public_key. Once an SSH key is created, it can be used in other calls such as creating Servers.

  • sshKeys.putSshKeysId

    Updates an SSH key. You can update an SSH key name and an SSH key labels.

    Please note that when updating labels, the SSH key current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body.

  • volumeActions.getVolumesIdActions

    Returns all Action objects for a Volume. You can sort the results by using the sort URI parameter, and filter them with the status parameter.

  • volumeActions.getVolumesIdActionsActionId

    Returns a specific Action for a Volume.

  • volumeActions.postVolumesIdActionsAttach

    Attaches a Volume to a Server. Works only if the Server is in the same Location as the Volume.

  • volumeActions.postVolumesIdActionsChangeProtection

    Changes the protection configuration of a Volume.

  • volumeActions.postVolumesIdActionsDetach

    Detaches a Volume from the Server it’s attached to. You may attach it to a Server again at a later time.

  • volumeActions.postVolumesIdActionsResize

    Changes the size of a Volume. Note that downsizing a Volume is not possible.

  • volumes.deleteVolumesId

    Deletes a volume. All Volume data is irreversibly destroyed. The Volume must not be attached to a Server and it must not have delete protection enabled.

  • volumes.getVolumes

    Gets all existing Volumes that you have available.

  • volumes.getVolumesId

    Gets a specific Volume object.

  • volumes.postVolumes

    Creates a new Volume attached to a Server. If you want to create a Volume that is not attached to a Server, you need to provide the location key instead of server. This can be either the ID or the name of the Location this Volume will be created in. Note that a Volume can be attached to a Server only in the same Location as the Volume itself.

    Specifying the Server during Volume creation will automatically attach the Volume to that Server after it has been initialized. In that case, the next_actions key in the response is an array which contains a single attach_volume action.

    The minimum Volume size is 10GB and the maximum size is 10TB (10240GB).

    A volume’s name can consist of alphanumeric characters, dashes, underscores, and dots, but has to start and end with an alphanumeric character. The total length is limited to 64 characters. Volume names must be unique per Project.

    Call specific error codes

    CodeDescription
    no_space_left_in_locationThere is no volume space left in the given location
  • volumes.putVolumesId

    Updates the Volume properties.

    Note that when updating labels, the volume’s current set of labels will be replaced with the labels provided in the request body. So, for example, if you want to add a new label, you have to provide all existing labels plus the new label in the request body.

  • openapi.previewSpec

    Preview an OpenAPI document before adding it as a source

  • openapi.addSource

    Add an OpenAPI source and register its operations as tools