---
title: "Service: /hosts/{hostname} [PATCH]"
source: https://dev.pageseeder.com/api/services/host_patch.html
description: "Edits an existing host by updating specified parameters like name, external status, or virtual status. Requires administrator permission and returns the updated host configuration."
last_updated: 2026-09-08T13:54:52+10:00
document_type: api_endpoint
operation_id: host-PATCH
resource_id: host
path_template: /hosts/{hostname}
http_method: PATCH
api_category: host
implementation_version: 6.2004
api_since: 5.8900
deprecated_since: null
obsolete_since: null
api_support: supported
cache_control: N/A
generated_at: 2026-09-02
tokens: ~348
---

# /hosts/\{hostname\} \[PATCH\]

## Description

Edits a host – only changes specified parameters.

## Parameters

| Name | Description | Required | Type | Default value |
| --- | --- | --- | --- | --- |
| external | Whether the host is external | no | boolean |  |
| name | The new name of the host | no | string |  |
| virtual | Whether the host is virtual. *PageSeeder v5.99 or higher.* | no | boolean |  |

### name

The name of the host to create must be at least two characters long, at most 255 characters long, a valid host according to [RFC 3986 - section 3.2.2 host](https://tools.ietf.org/html/rfc3986#section-3.2.2), and match the following regular expression:

```regex
([a-z0-9]([a-z0-9-]*[a-z0-9])?\.?)+[a-z0-9]([a-z0-9-]*[a-z0-9])?
```

PageSeeder supports IPv4 addresses and regular names.

> **Note:** The hostname is not case-sensitive and it is not case-preserving: it is always converted to lower case before being stored in the database.

## Permission

This service requires administrator.

## Response

The updated host is returned as a `<host>` element and includes any existing `<alias>`

```xml

<host-modification>
  <host id="1" name="mycompany.com" external="false" virtual="true">
    <aliases>
      <alias id="3" name="www.mycompany.com"/>
    </aliases>
  </host>
</host-modification>
```

## Error Handling

No specific errors expected for this service.

