Skip to content

Hetzner Cloud API API

by hetzner.cloud

No authHTTPSCloud Platforms
Open documentation ↗

Overview

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 [hcloud](https://github.com/hetznercloud/cli) * Our [library for Go](https://github.com/hetznercloud/hcloud-go) * Our [library for Python](https://github.com/hetznercloud/hcloud-python) Also you can find a [list of libraries, tools, and integrations on GitHub](https://github.com/hetznercloud/awesome-hcloud). 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 [Hetzner Cloud Console](https://console.hetzner.cloud/) 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 [curl](https://curl.haxx.se/). 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 [Pagination](https://docs.hetzner.cloud/#overview-pagination). **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 [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a Project, go to `Security` → `API 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: | Keys | Meaning | |-----------|-----------------------------------------------------------------------| | `code` | Short string indicating the type of error (machine-parsable) | | `message` | Textual description on what has gone wrong | | `details` | An 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 | Code | Description | |---------------------

Hetzner Cloud API is a cloud platforms API from hetzner.cloud. It needs no API key. It is served over HTTPS. Its OpenAPI description documents 144 endpoints.

At a glance

Authentication
No auth
HTTPS
Yes
CORS
Unknown
Base URL
https://api.hetzner.cloud/v1
Version
1.0.0
Endpoints
144
Spec updated
2023-03-06

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://api.hetzner.cloud/v1/actions" \
  -H "Accept: application/json"
JavaScript
const response = await fetch("https://api.hetzner.cloud/v1/actions", {
  method: "GET",
  headers: {
    "Accept": "application/json",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://api.hetzner.cloud/v1/actions",
    headers={
    "Accept": "application/json",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/actionsGet all Actions
GET/actions/{id}Get an Action
GET/certificatesGet all Certificates
POST/certificatesCreate a Certificate
GET/certificates/{id}Get a Certificate
PUT/certificates/{id}Update a Certificate
DELETE/certificates/{id}Delete a Certificate
GET/certificates/{id}/actionsGet all Actions for a Certificate
POST/certificates/{id}/actions/retryRetry Issuance or Renewal
GET/certificates/{id}/actions/{action_id}Get an Action for a Certificate
GET/datacentersGet all Datacenters
GET/datacenters/{id}Get a Datacenter
GET/firewallsGet all Firewalls
POST/firewallsCreate a Firewall
GET/firewalls/{id}Get a Firewall
PUT/firewalls/{id}Update a Firewall
DELETE/firewalls/{id}Delete a Firewall
GET/firewalls/{id}/actionsGet all Actions for a Firewall
POST/firewalls/{id}/actions/apply_to_resourcesApply to Resources
POST/firewalls/{id}/actions/remove_from_resourcesRemove from Resources
POST/firewalls/{id}/actions/set_rulesSet Rules
GET/firewalls/{id}/actions/{action_id}Get an Action for a Firewall
GET/floating_ipsGet all Floating IPs
POST/floating_ipsCreate a Floating IP
GET/floating_ips/{id}Get a Floating IP
PUT/floating_ips/{id}Update a Floating IP
DELETE/floating_ips/{id}Delete a Floating IP
GET/floating_ips/{id}/actionsGet all Actions for a Floating IP
POST/floating_ips/{id}/actions/assignAssign a Floating IP to a Server
POST/floating_ips/{id}/actions/change_dns_ptrChange reverse DNS entry for a Floating IP
POST/floating_ips/{id}/actions/change_protectionChange Floating IP Protection
POST/floating_ips/{id}/actions/unassignUnassign a Floating IP
GET/floating_ips/{id}/actions/{action_id}Get an Action for a Floating IP
GET/imagesGet all Images
GET/images/{id}Get an Image
PUT/images/{id}Update an Image
DELETE/images/{id}Delete an Image
GET/images/{id}/actionsGet all Actions for an Image
POST/images/{id}/actions/change_protectionChange Image Protection
GET/images/{id}/actions/{action_id}Get an Action for an Image
GET/isosGet all ISOs
GET/isos/{id}Get an ISO
GET/load_balancer_typesGet all Load Balancer Types
GET/load_balancer_types/{id}Get a Load Balancer Type
GET/load_balancersGet all Load Balancers
POST/load_balancersCreate a Load Balancer
GET/load_balancers/{id}Get a Load Balancer
PUT/load_balancers/{id}Update a Load Balancer
DELETE/load_balancers/{id}Delete a Load Balancer
GET/load_balancers/{id}/actionsGet all Actions for a Load Balancer
POST/load_balancers/{id}/actions/add_serviceAdd Service
POST/load_balancers/{id}/actions/add_targetAdd Target
POST/load_balancers/{id}/actions/attach_to_networkAttach a Load Balancer to a Network
POST/load_balancers/{id}/actions/change_algorithmChange Algorithm
POST/load_balancers/{id}/actions/change_dns_ptrChange reverse DNS entry for this Load Balancer
POST/load_balancers/{id}/actions/change_protectionChange Load Balancer Protection
POST/load_balancers/{id}/actions/change_typeChange the Type of a Load Balancer
POST/load_balancers/{id}/actions/delete_serviceDelete Service
POST/load_balancers/{id}/actions/detach_from_networkDetach a Load Balancer from a Network
POST/load_balancers/{id}/actions/disable_public_interfaceDisable the public interface of a Load Balancer
POST/load_balancers/{id}/actions/enable_public_interfaceEnable the public interface of a Load Balancer
POST/load_balancers/{id}/actions/remove_targetRemove Target
POST/load_balancers/{id}/actions/update_serviceUpdate Service
GET/load_balancers/{id}/actions/{action_id}Get an Action for a Load Balancer
GET/load_balancers/{id}/metricsGet Metrics for a LoadBalancer
GET/locationsGet all Locations
GET/locations/{id}Get a Location
GET/networksGet all Networks
POST/networksCreate a Network
GET/networks/{id}Get a Network
PUT/networks/{id}Update a Network
DELETE/networks/{id}Delete a Network
GET/networks/{id}/actionsGet all Actions for a Network
POST/networks/{id}/actions/add_routeAdd a route to a Network
POST/networks/{id}/actions/add_subnetAdd a subnet to a Network
POST/networks/{id}/actions/change_ip_rangeChange IP range of a Network
POST/networks/{id}/actions/change_protectionChange Network Protection
POST/networks/{id}/actions/delete_routeDelete a route from a Network
POST/networks/{id}/actions/delete_subnetDelete a subnet from a Network
GET/networks/{id}/actions/{action_id}Get an Action for a Network
GET/placement_groupsGet all PlacementGroups
POST/placement_groupsCreate a PlacementGroup
GET/placement_groups/{id}Get a PlacementGroup
PUT/placement_groups/{id}Update a PlacementGroup
DELETE/placement_groups/{id}Delete a PlacementGroup
GET/pricingGet all prices
GET/primary_ipsGet all Primary IPs
POST/primary_ipsCreate a Primary IP
GET/primary_ips/{id}Get a Primary IP
PUT/primary_ips/{id}Update a Primary IP
DELETE/primary_ips/{id}Delete a Primary IP
POST/primary_ips/{id}/actions/assignAssign a Primary IP to a resource
POST/primary_ips/{id}/actions/change_dns_ptrChange reverse DNS entry for a Primary IP
POST/primary_ips/{id}/actions/change_protectionChange Primary IP Protection
POST/primary_ips/{id}/actions/unassignUnassign a Primary IP from a resource
GET/server_typesGet all Server Types
GET/server_types/{id}Get a Server Type
GET/serversGet all Servers
POST/serversCreate a Server
GET/servers/{id}Get a Server

Showing the first 100 of 144 endpoints; the full list is in the documentation.

Questions

Does the Hetzner Cloud API API need an API key?

No. The Hetzner Cloud API API can be called without an API key or sign-up, which makes it handy for prototypes and front-end demos.

Does the Hetzner Cloud API API support HTTPS?

Yes, the Hetzner Cloud API API is served over HTTPS.

How many endpoints does the Hetzner Cloud API API have?

Its OpenAPI description lists 144 endpoints in version 1.0.0. The first 100 are shown on this page.

What are alternatives to the Hetzner Cloud API API?

Other Cloud Platforms APIs include Remote Settings PROD, Linode API, DigitalOcean API, Vercel API, Platform API.

Compare alternatives →

Remote Settings PROD

Cloud Platforms

Firefox is a free web browser backed by Mozilla, a non-profit dedicated to internet health and privacy.

No auth19 endpoints

Linode API

Cloud Platforms

## Introduction The Linode API provides the ability to programmatically manage the full range of Linode products and services. This reference is designed to assist application developers and system administrators. Each endpoint includes descriptions, request syntax, and examples using standard HTTP requests. Response data is returned in JSON format. This document was generated from our OpenAPI Specification. See the <a target="_top" href="https://www.openapis.org">OpenAPI website</a> for more information. <a target="_top" href="/docs/api/openapi.yaml">Download the Linode OpenAPI Specification</a>. ## Changelog <a target="_top" href="/docs/products/tools/api/release-notes/">View our Changelog</a> to see release notes on all changes made to our API. ## Access and Authentication Some endpoints are publicly accessible without requiring authentication. All endpoints affecting your Account, however, require either a Personal Access Token or OAuth authentication (when using third-party applications). ### Personal Access Token The easiest way to access the API is with a Personal Access Token (PAT) generated from the <a target="_top" href="https://cloud.linode.com/profile/tokens">Linode Cloud Manager</a> or the [Create Personal Access Token](/docs/api/profile/#personal-access-token-create) endpoint. All scopes for the OAuth security model ([defined below](/docs/api/profile/#oauth)) apply to this security model as well. #### Authentication | Security Scheme Type: | HTTP | |-----------------------|------| | **HTTP Authorization Scheme** | bearer | ### OAuth If you only need to access the Linode API for personal use, we recommend that you create a [personal access token](/docs/api/#personal-access-token). If you're designing an application that can authenticate with an arbitrary Linode user, then you should use the OAuth 2.0 workflows presented in this section. For a more detailed example of an OAuth 2.0 implementation, see our guide on [How to Create an OAuth App with the Linode Python API Library](/docs/products/tools/api/guides/create-an-oauth-app-with-the-python-api-library/#oauth-2-authentication-exchange). Before you implement OAuth in your application, you first need to create an OAuth client. You can do this [with the Linode API](/docs/api/account/#oauth-client-create) or [via the Cloud Manager](https://cloud.linode.com/profile/clients): - When creating the client, you'll supply a `label` and a `redirect_uri` (referred to as the Callback URL in the Cloud Manager). - The response from this endpoint will give you a `client_id` and a `secret`. - Clients can be public or private, and are private by default. You can choose to make the client public when it is created. - A private client is used with applications which can securely store the client secret (that is, the secret returned to you when you first created the client). For example, an application running on a secured server that only the developer has access to would use a private OAuth client. This is also called a confidential client in some OAuth documentation. - A public client is used with applications where the client secret is not guaranteed to be secure. For example, a native app running on a user's computer may not be able to keep the client secret safe, as a user could potentially inspect the source of the application. So, native apps or apps that run in a user's browser should use a public client. - Public and private clients follow different workflows, as described below. #### OAuth Workflow The OAuth workflow is a series of exchanges between your third-party app and Linode. The workflow is used to authenticate a user before an application can start making API calls on the user's behalf. Notes: - With respect to the diagram in [section 1.2 of RFC 6749](https://tools.ietf.org/html/rfc6749#section-1.2), login.linode.com (referred to in this section as the *login server*) is the Resource Owner and the Authorization Server; api.linode.com (referred to here as the *api se

Bearer token350 endpoints

DigitalOcean API

Cloud Platforms

# Introduction The DigitalOcean API allows you to manage Droplets and resources within the DigitalOcean cloud in a simple, programmatic way using conventional HTTP requests. All of the functionality that you are familiar with in the DigitalOcean control panel is also available through the API, allowing you to script the complex actions that your situation requires. The API documentation will start with a general overview about the design and technology that has been implemented, followed by reference information about specific endpoints. ## Requests Any tool that is fluent in HTTP can communicate with the API simply by requesting the correct URI. Requests should be made using the HTTPS protocol so that traffic is encrypted. The interface responds to different methods depending on the action required. |Method|Usage| |--- |--- | |GET|For simple retrieval of information about your account, Droplets, or environment, you should use the GET method. The information you request will be returned to you as a JSON object. The attributes defined by the JSON object can be used to form additional requests. Any request using the GET method is read-only and will not affect any of the objects you are querying.| |DELETE|To destroy a resource and remove it from your account and environment, the DELETE method should be used. This will remove the specified object if it is found. If it is not found, the operation will return a response indicating that the object was not found. This idempotency means that you do not have to check for a resource's availability prior to issuing a delete command, the final state will be the same regardless of its existence.| |PUT|To update the information about a resource in your account, the PUT method is available. Like the DELETE Method, the PUT method is idempotent. It sets the state of the target using the provided values, regardless of their current values. Requests using the PUT method do not need to check the current attributes of the object.| |PATCH|Some resources support partial modification. In these cases, the PATCH method is available. Unlike PUT which generally requires a complete representation of a resource, a PATCH request is is a set of instructions on how to modify a resource updating only specific attributes.| |POST|To create a new object, your request should specify the POST method. The POST request includes all of the attributes necessary to create a new object. When you wish to create a new object, send a POST request to the target endpoint.| |HEAD|Finally, to retrieve metadata information, you should use the HEAD method to get the headers. This returns only the header of what would be returned with an associated GET request. Response headers contain some useful information about your API access and the results that are available for your request. For instance, the headers contain your current rate-limit value and the amount of time available until the limit resets. It also contains metrics about the total number of objects found, pagination information, and the total content length.| ## HTTP Statuses Along with the HTTP methods that the API responds to, it will also return standard HTTP statuses, including error codes. In the event of a problem, the status will contain the error code, while the body of the response will usually contain additional information about the problem that was encountered. In general, if the status returned is in the 200 range, it indicates that the request was fulfilled successfully and that no error was encountered. Return codes in the 400 range typically indicate that there was an issue with the request that was sent. Among other things, this could mean that you did not authenticate correctly, that you are requesting an action that you do not have authorization for, that the object you are requesting does not exist, or that your request is malformed. If you receive a status in the 500 range, this generally indicates a server-side problem. This means that we are having

Bearer token290 endpoints

Vercel API

Cloud Platforms

Vercel combines the best developer experience with an obsessive focus on end-user performance. Our platform enables frontend teams to do their best work.

Bearer token112 endpoints

Platform API

Cloud Platforms

The [REST API specification](https://www.ably.io/documentation/rest-api) for Ably.

HTTP Basic22 endpoints

Azure Data Lake Storage

Cloud Platforms

Azure Data Lake Storage provides storage for Hadoop and other big data workloads.

No auth10 endpoints

Listed from APIs.guru (CC0).