Hetzner Cloud API
  1. Server Actions
Hetzner Cloud API
  • Actions
    • Get all Actions
      GET
    • Get an Action
      GET
  • Certificates
    • Get all Certificates
      GET
    • Create a Certificate
      POST
    • Delete a Certificate
      DELETE
    • Get a Certificate
      GET
    • Update a Certificate
      PUT
  • Certificate Actions
    • Get all Actions for a Certificate
    • Retry Issuance or Renewal
    • Get an Action for a Certificate
  • Datacenters
    • Get all Datacenters
    • Get a Datacenter
  • Firewalls
    • Get all Firewalls
    • Create a Firewall
    • Delete a Firewall
    • Get a Firewall
    • Update a Firewall
  • Firewall Actions
    • Get all Actions for a Firewall
    • Apply to Resources
    • Remove from Resources
    • Set Rules
    • Get an Action for a Firewall
  • Floating IPs
    • Get all Floating IPs
    • Create a Floating IP
    • Delete a Floating IP
    • Get a Floating IP
    • Update a Floating IP
  • Floating IP Actions
    • Get all Actions for a Floating IP
    • Assign a Floating IP to a Server
    • Change reverse DNS entry for a Floating IP
    • Change Floating IP Protection
    • Unassign a Floating IP
    • Get an Action for a Floating IP
  • Images
    • Get all Images
    • Delete an Image
    • Get an Image
    • Update an Image
  • Image Actions
    • Get all Actions for an Image
    • Change Image Protection
    • Get an Action for an Image
  • ISOs
    • Get all ISOs
    • Get an ISO
  • Load Balancer Types
    • Get all Load Balancer Types
    • Get a Load Balancer Type
  • Load Balancers
    • Get all Load Balancers
    • Create a Load Balancer
    • Delete a Load Balancer
    • Get a Load Balancer
    • Update a Load Balancer
    • Get Metrics for a LoadBalancer
  • Load Balancer Actions
    • Get all Actions for a Load Balancer
    • Add Service
    • Add Target
    • Attach a Load Balancer to a Network
    • Change Algorithm
    • Change reverse DNS entry for this Load Balancer
    • Change Load Balancer Protection
    • Change the Type of a Load Balancer
    • Delete Service
    • Detach a Load Balancer from a Network
    • Disable the public interface of a Load Balancer
    • Enable the public interface of a Load Balancer
    • Remove Target
    • Update Service
    • Get an Action for a Load Balancer
  • Locations
    • Get all Locations
    • Get a Location
  • Networks
    • Get all Networks
    • Create a Network
    • Delete a Network
    • Get a Network
    • Update a Network
  • Network Actions
    • Get all Actions for a Network
    • Add a route to a Network
    • Add a subnet to a Network
    • Change IP range of a Network
    • Change Network Protection
    • Delete a route from a Network
    • Delete a subnet from a Network
    • Get an Action for a Network
  • Placement Groups
    • Get all PlacementGroups
    • Create a PlacementGroup
    • Delete a PlacementGroup
    • Get a PlacementGroup
    • Update a PlacementGroup
  • Pricing
    • Get all prices
  • Server Types
    • Get all Server Types
    • Get a Server Type
  • Servers
    • Get all Servers
    • Create a Server
    • Delete a Server
    • Get a Server
    • Update a Server
    • Get Metrics for a Server
  • Server Actions
    • Get all Actions for a Server
      GET
    • Add a Server to a Placement Group
      POST
    • Attach an ISO to a Server
      POST
    • Attach a Server to a Network
      POST
    • Change alias IPs of a Network
      POST
    • Change reverse DNS entry for this Server
      POST
    • Change Server Protection
      POST
    • Change the Type of a Server
      POST
    • Create Image from a Server
      POST
    • Detach a Server from a Network
      POST
    • Detach an ISO from a Server
      POST
    • Disable Backups for a Server
      POST
    • Disable Rescue Mode for a Server
      POST
    • Enable and Configure Backups for a Server
      POST
    • Enable Rescue Mode for a Server
      POST
    • Power off a Server
      POST
    • Power on a Server
      POST
    • Soft-reboot a Server
      POST
    • Rebuild a Server from an Image
      POST
    • Remove from Placement Group
      POST
    • Request Console for a Server
      POST
    • Reset a Server
      POST
    • Reset root Password of a Server
      POST
    • Shutdown a Server
      POST
    • Get an Action for a Server
      GET
  • SSH Keys
    • Get all SSH keys
    • Create an SSH key
    • Delete an SSH key
    • Get a SSH key
    • Update an SSH key
  • Volumes
    • Get all Volumes
    • Create a Volume
    • Delete a Volume
    • Get a Volume
    • Update a Volume
  • Volume Actions
    • Get all Actions for a Volume
    • Attach Volume to a Server
    • Change Volume Protection
    • Detach Volume
    • Resize Volume
    • Get an Action for a Volume
  • Primary IPs
    • Get all Primary IPs
    • Create a Primary IP
    • Delete a Primary IP
    • Get a Primary IP
    • Update a Primary IP
  • Primary IP Actions
    • Assign a Primary IP to a resource
    • Change reverse DNS entry for a Primary IP
    • Change Primary IP Protection
    • Unassign a Primary IP from a resource
  1. Server Actions

Rebuild a Server from an Image

POST
/servers/{id}/actions/rebuild
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.

Request

Path Params

Body Params application/json

Examples

Responses

🟢201The `action` key in the reply contains an Action object with this structure
application/json
Body

Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.hetzner.cloud/v1/servers//actions/rebuild' \
--header 'Content-Type: application/json' \
--data-raw '{
    "image": "ubuntu-20.04"
}'
Response Response Example
{
    "action": {
        "command": "rebuild_server",
        "error": {
            "code": "action_failed",
            "message": "Action failed"
        },
        "finished": null,
        "id": 13,
        "progress": 0,
        "resources": [
            {
                "id": 42,
                "type": "server"
            }
        ],
        "started": "2016-01-30T23:50:00.000Z",
        "status": "running"
    },
    "root_password": null
}
Modified at 2023-08-16 03:09:21
Previous
Soft-reboot a Server
Next
Remove from Placement Group
Built with