# VirtualHost Config

<a id="delete-api-v1-accounts-username-domains-domain-vhost-config"></a>
#### `DELETE /api/v1/accounts/{username}/domains/{domain}/vhost-config`

*Delete Vhost Config*

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `username` | string | yes | — |
| `domain` | string | yes | — |

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `object` | Successful Response |
| `422` | `HTTPValidationError` | Validation Error |

**Response example (200):**

```json
{}
```

**cURL example:**

```bash
curl -X DELETE \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  https://your-server:2000/api/v1/accounts/{username}/domains/{domain}/vhost-config
```

---

<a id="get-api-v1-accounts-username-domains-domain-vhost-config"></a>
#### `GET /api/v1/accounts/{username}/domains/{domain}/vhost-config`

*Get Vhost Config*

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `username` | string | yes | — |
| `domain` | string | yes | — |

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `object` | Successful Response |
| `422` | `HTTPValidationError` | Validation Error |

**Response example (200):**

```json
{}
```

**cURL example:**

```bash
curl -X GET \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  https://your-server:2000/api/v1/accounts/{username}/domains/{domain}/vhost-config
```

---

<a id="put-api-v1-accounts-username-domains-domain-vhost-config"></a>
#### `PUT /api/v1/accounts/{username}/domains/{domain}/vhost-config`

*Update Vhost Config*

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `username` | string | yes | — |
| `domain` | string | yes | — |

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `apache_config` | string | no | Custom Apache directives injected into the VirtualHost block |
| `nginx_config` | string | no | Custom Nginx directives injected into the server block |
| `ols_config` | string | no | Custom OLS directives injected into vhconf.conf |

**Request body example:**

```json
{
  "apache_config": "string",
  "nginx_config": "string",
  "ols_config": "string"
}
```

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `object` | Successful Response |
| `422` | `HTTPValidationError` | Validation Error |

**Response example (200):**

```json
{}
```

**cURL example:**

```bash
curl -X PUT \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  -H "Content-Type: application/json" \
  -d @body.json \
  https://your-server:2000/api/v1/accounts/{username}/domains/{domain}/vhost-config
```

---
