Hetzner Cloud API
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 Security → API 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
Example Response
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 Security → API Tokens, and generate a new token.
Example Authorization header
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:
Example response
Error Codes
invalid_input
uniqueness_error
resource_limit_exceeded
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
Label Selector
For resources with labels, you can filter resources by their labels using the label selector query language.
Examples
-
Returns all resources that have a
env=productionlabel and that don't have atype=databaselabel:env=production,type!=database -
Returns all resources that have a
env=testingorenv=staginglabel:env in (testing,staging) -
Returns all resources that don't have a
typelabel:!type
Pagination
Responses which return multiple items support pagination. If they do support pagination, it can be controlled with following query string parameters:
- A
pageparameter specifies the page to fetch. The number of the first page is 1. - A
per_pageparameter 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
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
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-Limitheader contains the total number of requests you can perform per hour. - The
RateLimit-Remainingheader contains the number of requests remaining in the current rate limit time frame. - The
RateLimit-Resetheader 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:
Example: Summary
Example: Hostname
Example: Instance ID
Example: Public IPv4
Example: Private Networks
Example: Availability Zone
Example: Region
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
curl -H "Authorization: Bearer jEheVytlAoFl7F8MqUQ7jAo2hOXASztX" \ https://api.hetzner.cloud/v1/servers{ "servers": [], "meta": { "pagination": { "page": 1, "per_page": 25, "previous_page": null, "next_page": null, "last_page": 1, "total_entries": 0 } }}Authorization: Bearer LRK9DAWQ1ZAEFSrCNEEzLCUwhYX1U3g7wMg4dTlkkDC96fyDuyJ39nVbVjCKSDfj{ "error": { "code": "invalid_input", "message": "invalid input in field 'broken_field': is too long", "details": { "fields": [ { "name": "broken_field", "messages": ["is too long"] } ] } }}{ "error": { "code": "invalid_input", "message": "invalid input in field 'broken_field': is too long", "details": { "fields": [ { "name": "broken_field", "messages": ["is too long"] } ] } }}{ "error": { "code": "uniqueness_error", "message": "SSH key with the same fingerprint already exists", "details": { "fields": [ { "name": "public_key" } ] } }}{ "error": { "code": "resource_limit_exceeded", "message": "project limit exceeded", "details": { "limits": [ { "name": "project_limit" } ] } }}{ "labels": { "environment":"development", "service":"backend", "example.com/my":"label", "just-a-key":"" }}{ "servers": [...], "meta": { "pagination": { "page": 2, "per_page": 25, "previous_page": 1, "next_page": 3, "last_page": 4, "total_entries": 100 } }}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"$ curl http://169.254.169.254/hetzner/v1/metadataavailability-zone: hel1-dc2hostname: my-serverinstance-id: 42public-ipv4: 1.2.3.4region: eu-central$ curl http://169.254.169.254/hetzner/v1/metadata/hostnamemy-server$ curl http://169.254.169.254/hetzner/v1/metadata/instance-id42$ curl http://169.254.169.254/hetzner/v1/metadata/public-ipv41.2.3.4$ curl http://169.254.169.254/hetzner/v1/metadata/private-networks- 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$ curl http://169.254.169.254/hetzner/v1/metadata/availability-zonehel1-dc2$ curl http://169.254.169.254/hetzner/v1/metadata/regioneu-centralhttps://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.getActionsReturns all Action objects. You can
sortthe results by using the sort URI parameter, and filter them with thestatusparameter. -
actions.getActionsIdReturns a specific Action object.
-
certificateActions.getCertificatesIdActionsReturns all Action objects for a Certificate. You can sort the results by using the
sortURI parameter, and filter them with thestatusparameter.Only type
managedCertificates can have Actions. For typeuploadedCertificates theactionskey will always contain an empty array. -
certificateActions.getCertificatesIdActionsActionIdReturns a specific Action for a Certificate. Only type
managedCertificates have Actions. -
certificateActions.postCertificatesIdActionsRetryRetry a failed Certificate issuance or renewal.
Only applicable if the type of the Certificate is
managedand the issuance or renewal status isfailed.Call specific error codes
-
certificates.deleteCertificatesIdDeletes a Certificate.
-
certificates.getCertificatesReturns all Certificate objects.
-
certificates.getCertificatesIdGets a specific Certificate object.
-
certificates.postCertificatesCreates a new Certificate.
The default type uploaded allows for uploading your existing
certificateandprivate_keyin 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
managedCertificates theactionkey of the response contains the Action that allows for tracking the issuance process. For typeuploadedCertificates theactionis always null. -
certificates.putCertificatesIdUpdates 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.getDatacentersReturns all Datacenter objects.
-
datacenters.getDatacentersIdReturns a specific Datacenter object.
-
firewallActions.getFirewallsIdActionsReturns all Action objects for a Firewall. You can sort the results by using the
sortURI parameter, and filter them with thestatusparameter. -
firewallActions.getFirewallsIdActionsActionIdReturns a specific Action for a Firewall.
-
firewallActions.postFirewallsIdActionsApplyToResourcesApplies one Firewall to multiple resources.
Currently servers (public network interface) and label selectors are supported.
Call specific error codes
-
firewallActions.postFirewallsIdActionsRemoveFromResourcesRemoves one Firewall from multiple resources.
Currently only Servers (and their public network interfaces) are supported.
Call specific error codes
-
firewallActions.postFirewallsIdActionsSetRulesSets the rules of a Firewall.
All existing rules will be overwritten. Pass an empty
rulesarray to remove all rules. The maximum amount of rules that can be defined is 50.Call specific error codes
-
firewalls.deleteFirewallsIdDeletes a Firewall.
Call specific error codes
-
firewalls.getFirewallsReturns all Firewall objects.
-
firewalls.getFirewallsIdGets a specific Firewall object.
-
firewalls.postFirewallsCreates a new Firewall.
Call specific error codes
-
firewalls.putFirewallsIdUpdates 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.getFloatingIpsIdActionsReturns all Action objects for a Floating IP. You can sort the results by using the
sortURI parameter, and filter them with thestatusparameter. -
floatingIpActions.getFloatingIpsIdActionsActionIdReturns a specific Action object for a Floating IP.
-
floatingIpActions.postFloatingIpsIdActionsAssignAssigns a Floating IP to a Server.
-
floatingIpActions.postFloatingIpsIdActionsChangeDnsPtrChanges the hostname that will appear when getting the hostname belonging to this Floating IP.
-
floatingIpActions.postFloatingIpsIdActionsChangeProtectionChanges the protection configuration of the Floating IP.
-
floatingIpActions.postFloatingIpsIdActionsUnassignUnassigns a Floating IP, resulting in it being unreachable. You may assign it to a Server again at a later time.
-
floatingIPs.deleteFloatingIpsIdDeletes a Floating IP. If it is currently assigned to a Server it will automatically get unassigned.
-
floatingIPs.getFloatingIpsReturns all Floating IP objects.
-
floatingIPs.getFloatingIpsIdReturns a specific Floating IP object.
-
floatingIPs.postFloatingIpsCreates 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_locationkey instead ofserver. 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.putFloatingIpsIdUpdates 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.getImagesIdActionsReturns all Action objects for an Image. You can sort the results by using the
sortURI parameter, and filter them with thestatusparameter. -
imageActions.getImagesIdActionsActionIdReturns a specific Action for an Image.
-
imageActions.postImagesIdActionsChangeProtectionChanges the protection configuration of the Image. Can only be used on snapshots.
-
images.deleteImagesIdDeletes an Image. Only Images of type
snapshotandbackupcan be deleted. -
images.getImagesReturns all Image objects. You can select specific Image types only and sort the results by using URI parameters.
-
images.getImagesIdReturns a specific Image object.
-
images.putImagesIdUpdates the Image. You may change the description, convert a Backup Image to a Snapshot Image or change the Image labels. Only Images of type
snapshotandbackupcan 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.getIsosReturns all available ISO objects.
-
isOs.getIsosIdReturns a specific ISO object.
-
loadBalancerActions.getLoadBalancersIdActionsReturns all Action objects for a Load Balancer. You can sort the results by using the
sortURI parameter, and filter them with thestatusparameter. -
loadBalancerActions.getLoadBalancersIdActionsActionIdReturns a specific Action for a Load Balancer.
-
loadBalancerActions.postLoadBalancersIdActionsAddServiceAdds a service to a Load Balancer.
Call specific error codes
-
loadBalancerActions.postLoadBalancersIdActionsAddTargetAdds a target to a Load Balancer.
Call specific error codes
-
loadBalancerActions.postLoadBalancersIdActionsAttachToNetworkAttach a Load Balancer to a Network.
Call specific error codes
-
loadBalancerActions.postLoadBalancersIdActionsChangeAlgorithmChange the algorithm that determines to which target new requests are sent.
-
loadBalancerActions.postLoadBalancersIdActionsChangeDnsPtrChanges 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.postLoadBalancersIdActionsChangeProtectionChanges the protection configuration of a Load Balancer.
-
loadBalancerActions.postLoadBalancersIdActionsChangeTypeChanges the type (Max Services, Max Targets and Max Connections) of a Load Balancer.
Call specific error codes
-
loadBalancerActions.postLoadBalancersIdActionsDeleteServiceDelete a service of a Load Balancer.
-
loadBalancerActions.postLoadBalancersIdActionsDetachFromNetworkDetaches a Load Balancer from a network.
-
loadBalancerActions.postLoadBalancersIdActionsDisablePublicInterfaceDisable 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
-
loadBalancerActions.postLoadBalancersIdActionsEnablePublicInterfaceEnable the public interface of a Load Balancer. The Load Balancer will be accessible from the internet via its public IPs.
-
loadBalancerActions.postLoadBalancersIdActionsRemoveTargetRemoves a target from a Load Balancer.
-
loadBalancerActions.postLoadBalancersIdActionsUpdateServiceUpdates a Load Balancer Service.
Call specific error codes
-
loadBalancers.deleteLoadBalancersIdDeletes a Load Balancer.
-
loadBalancers.getLoadBalancersGets all existing Load Balancers that you have available.
-
loadBalancers.getLoadBalancersIdGets a specific Load Balancer object.
-
loadBalancers.getLoadBalancersIdMetricsYou must specify the type of metric to get:
open_connections,connections_per_second,requests_per_secondorbandwidth. 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:
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.postLoadBalancersCreates a Load Balancer.
Call specific error codes
-
loadBalancers.putLoadBalancersIdUpdates 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.getLoadBalancerTypesGets all Load Balancer type objects.
-
loadBalancerTypes.getLoadBalancerTypesIdGets a specific Load Balancer type object.
-
locations.getLocationsReturns all Location objects.
-
locations.getLocationsIdReturns a specific Location object.
-
networkActions.getNetworksIdActionsReturns all Action objects for a Network. You can sort the results by using the
sortURI parameter, and filter them with thestatusparameter. -
networkActions.getNetworksIdActionsActionIdReturns a specific Action for a Network.
-
networkActions.postNetworksIdActionsAddRouteAdds a route entry to a Network.
Note: if the Network object changes during the request, the response will be a “conflict” error.
-
networkActions.postNetworksIdActionsAddSubnetAdds a new subnet object to the Network. If you do not specify an
ip_rangefor 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.postNetworksIdActionsChangeIpRangeChanges 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/16you want to extend then your new range must also start with the IP10.0.0.0. Your CIDR netmask/16may change to a number that is smaller than16thereby increasing the IP range. So valid entries would be10.0.0.0/15,10.0.0.0/14,10.0.0.0/13and 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.postNetworksIdActionsChangeProtectionChanges the protection configuration of a Network.
Note: if the Network object changes during the request, the response will be a “conflict” error.
-
networkActions.postNetworksIdActionsDeleteRouteDelete a route entry from a Network.
Note: if the Network object changes during the request, the response will be a “conflict” error.
-
networkActions.postNetworksIdActionsDeleteSubnetDeletes 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.deleteNetworksIdDeletes 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.getNetworksGets all existing networks that you have available.
-
networks.getNetworksIdGets a specific network object.
-
networks.postNetworksCreates 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 anip_rangein 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.putNetworksIdUpdates 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.deletePlacementGroupsIdDeletes a PlacementGroup.
-
placementGroups.getPlacementGroupsReturns all PlacementGroup objects.
-
placementGroups.getPlacementGroupsIdGets a specific PlacementGroup object.
-
placementGroups.postPlacementGroupsCreates a new PlacementGroup.
-
placementGroups.putPlacementGroupsIdUpdates 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.getPricingReturns 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.postPrimaryIpsIdActionsAssignAssigns a Primary IP to a Server.
A Server can only have one Primary IP of type
ipv4and one of typeipv6assigned. 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
-
primaryIpActions.postPrimaryIpsIdActionsChangeDnsPtrChanges the hostname that will appear when getting the hostname belonging to this Primary IP.
-
primaryIpActions.postPrimaryIpsIdActionsChangeProtectionChanges the protection configuration of a Primary IP.
A Primary IP can only be delete protected if its
auto_deleteproperty is set tofalse. -
primaryIpActions.postPrimaryIpsIdActionsUnassignUnassigns 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
-
primaryIPs.deletePrimaryIpsIdDeletes 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.getPrimaryIpsReturns all Primary IP objects.
-
primaryIPs.getPrimaryIpsIdReturns a specific Primary IP object.
-
primaryIPs.postPrimaryIpsCreates 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
datacenterkey instead ofassignee_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
-
primaryIPs.putPrimaryIpsIdUpdates 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.getServersIdActionsReturns all Action objects for a Server. You can
sortthe results by using the sort URI parameter, and filter them with thestatusparameter. -
serverActions.getServersIdActionsActionIdReturns a specific Action object for a Server.
-
serverActions.postServersIdActionsAddToPlacementGroupAdds a Server to a Placement Group.
Server must be powered off for this command to succeed.
Call specific error codes
-
serverActions.postServersIdActionsAttachIsoAttaches 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.postServersIdActionsAttachToNetworkAttaches 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
serverin the samenetwork_zone.Using the
alias_ipsattribute 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
-
serverActions.postServersIdActionsChangeAliasIpsChanges 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.postServersIdActionsChangeDnsPtrChanges 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.postServersIdActionsChangeProtectionChanges the protection configuration of the Server.
-
serverActions.postServersIdActionsChangeTypeChanges 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_typeand 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_disktofalse.Call specific error codes
-
serverActions.postServersIdActionsCreateImageCreates 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
backupImage that is bound to the Server and therefore will be deleted when the Server is deleted, or you can create ansnapshotImage 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.postServersIdActionsDetachFromNetworkDetaches a Server from a network. The interface for this network will vanish.
-
serverActions.postServersIdActionsDetachIsoDetaches 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.postServersIdActionsDisableBackupDisables 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.postServersIdActionsDisableRescueDisables 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.postServersIdActionsEnableBackupEnables 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.postServersIdActionsEnableRescueEnable 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.postServersIdActionsPoweroffCuts 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.postServersIdActionsPoweronStarts a Server by turning its power on.
-
serverActions.postServersIdActionsRebootReboots 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.postServersIdActionsRebuildRebuilds 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 (
backuporsnapshotImage) or it can be a completely freshsystemImage provided by us. You can get a list of all available Images withGET /images.Your Server will automatically be powered off before the rebuild command executes.
-
serverActions.postServersIdActionsRemoveFromPlacementGroupRemoves a Server from a Placement Group.
-
serverActions.postServersIdActionsRequestConsoleRequests 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.postServersIdActionsResetCuts 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.postServersIdActionsResetPasswordResets 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.postServersIdActionsShutdownShuts 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.deleteServersIdDeletes a Server. This immediately removes the Server from your account, and it is no longer accessible.
-
servers.getServersReturns all existing Server objects
-
servers.getServersIdReturns a specific Server object. The Server must exist inside the Project
-
servers.getServersIdMetricsGet 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
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.postServersCreates a new Server. Returns preliminary information about the Server as well as an Action that covers progress of creation.
-
servers.putServersIdUpdates 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.getServerTypesGets all Server type objects.
-
serverTypes.getServerTypesIdGets a specific Server type object.
-
sshKeys.deleteSshKeysIdDeletes an SSH key. It cannot be used anymore.
-
sshKeys.getSshKeysReturns all SSH key objects.
-
sshKeys.getSshKeysIdReturns a specific SSH key object.
-
sshKeys.postSshKeysCreates a new SSH key with the given
nameandpublic_key. Once an SSH key is created, it can be used in other calls such as creating Servers. -
sshKeys.putSshKeysIdUpdates 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.getVolumesIdActionsReturns all Action objects for a Volume. You can
sortthe results by using the sort URI parameter, and filter them with thestatusparameter. -
volumeActions.getVolumesIdActionsActionIdReturns a specific Action for a Volume.
-
volumeActions.postVolumesIdActionsAttachAttaches a Volume to a Server. Works only if the Server is in the same Location as the Volume.
-
volumeActions.postVolumesIdActionsChangeProtectionChanges the protection configuration of a Volume.
-
volumeActions.postVolumesIdActionsDetachDetaches a Volume from the Server it’s attached to. You may attach it to a Server again at a later time.
-
volumeActions.postVolumesIdActionsResizeChanges the size of a Volume. Note that downsizing a Volume is not possible.
-
volumes.deleteVolumesIdDeletes 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.getVolumesGets all existing Volumes that you have available.
-
volumes.getVolumesIdGets a specific Volume object.
-
volumes.postVolumesCreates 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
locationkey instead ofserver. 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_actionskey in the response is an array which contains a singleattach_volumeaction.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
-
volumes.putVolumesIdUpdates 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.previewSpecPreview an OpenAPI document before adding it as a source
-
openapi.addSourceAdd an OpenAPI source and register its operations as tools