# Client — Domains

<a id="post-api-v1-client-addon-domains"></a>
#### `POST /api/v1/client/addon-domains`

*Create addon domain (client)*

Create an addon domain for the authenticated client account. Plan limit enforced.

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `auto_ssl` | boolean | no | default `False` |
| `document_root` | string | no | — |
| `domain` | string | yes | — |
| `setup_dns` | boolean | no | default `True` |

**Request body example:**

```json
{
  "auto_ssl": false,
  "document_root": "string",
  "domain": "example.com",
  "setup_dns": true
}
```

**Responses:**

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

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X POST \
  -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/client/addon-domains
```

---

<a id="delete-api-v1-client-addon-domains-domain"></a>
#### `DELETE /api/v1/client/addon-domains/{domain}`

*Delete addon domain (client)*

Delete an addon domain owned by the authenticated client account.

**Path parameters:**

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

**Responses:**

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

**Response example (200):**

```json
{
  "message": "string",
  "status": "success"
}
```

**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/client/addon-domains/{domain}
```

---

<a id="get-api-v1-client-domains"></a>
#### `GET /api/v1/client/domains`

*List all domains (client)*

Return all domains (main, addon, subdomains, parked) for the authenticated client account.

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_list_dict_str__Any___` | Successful Response |

**Response example (200):**

```json
{
  "data": [
    {}
  ],
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**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/client/domains
```

---

<a id="get-api-v1-client-parked-domains"></a>
#### `GET /api/v1/client/parked-domains`

*List parked domains (client)*

Return all parked domains for the authenticated client account.

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_list_dict_str__Any___` | Successful Response |

**Response example (200):**

```json
{
  "data": [
    {}
  ],
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**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/client/parked-domains
```

---

<a id="post-api-v1-client-parked-domains"></a>
#### `POST /api/v1/client/parked-domains`

*Create parked domain (client)*

Create a parked (alias) domain for the authenticated client account.

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `domain` | string | yes | — |
| `target_domain` | string | no | — |

**Request body example:**

```json
{
  "domain": "example.com",
  "target_domain": "string"
}
```

**Responses:**

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

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X POST \
  -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/client/parked-domains
```

---

<a id="delete-api-v1-client-parked-domains-domain"></a>
#### `DELETE /api/v1/client/parked-domains/{domain}`

*Delete parked domain (client)*

Delete a parked domain owned by the authenticated client account.

**Path parameters:**

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

**Responses:**

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

**Response example (200):**

```json
{
  "message": "string",
  "status": "success"
}
```

**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/client/parked-domains/{domain}
```

---

<a id="get-api-v1-client-redirects"></a>
#### `GET /api/v1/client/redirects`

*List redirects (client)*

Return all URL redirects configured for the authenticated client account.

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_list_dict_str__Any___` | Successful Response |

**Response example (200):**

```json
{
  "data": [
    {}
  ],
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**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/client/redirects
```

---

<a id="post-api-v1-client-redirects"></a>
#### `POST /api/v1/client/redirects`

*Create redirect (client)*

Create a URL redirect for the authenticated client account.

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `destination_url` | string | yes | minLength=1; maxLength=2048 |
| `domain` | string | yes | — |
| `source_path` | string | yes | minLength=1; maxLength=2048 |
| `type` | string | no | default `301`; enum: `301`, `302` |

**Request body example:**

```json
{
  "destination_url": "string",
  "domain": "example.com",
  "source_path": "string",
  "type": "301"
}
```

**Responses:**

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

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X POST \
  -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/client/redirects
```

---

<a id="delete-api-v1-client-redirects-redirect-id"></a>
#### `DELETE /api/v1/client/redirects/{redirect_id}`

*Delete redirect (client)*

Delete a URL redirect owned by the authenticated client account.

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `redirect_id` | string | yes | — |

**Responses:**

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

**Response example (200):**

```json
{
  "message": "string",
  "status": "success"
}
```

**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/client/redirects/{redirect_id}
```

---

<a id="put-api-v1-client-redirects-redirect-id"></a>
#### `PUT /api/v1/client/redirects/{redirect_id}`

*Update redirect (client)*

Update a URL redirect owned by the authenticated client account.

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `redirect_id` | string | yes | — |

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `destination_url` | string | no | — |
| `source_path` | string | no | — |
| `type` | string | no | — |

**Request body example:**

```json
{
  "destination_url": "string",
  "source_path": "string",
  "type": "301"
}
```

**Responses:**

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

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**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/client/redirects/{redirect_id}
```

---

<a id="get-api-v1-client-subdomains"></a>
#### `GET /api/v1/client/subdomains`

*List subdomains (client)*

Return all subdomains for the authenticated client account.

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_list_dict_str__Any___` | Successful Response |

**Response example (200):**

```json
{
  "data": [
    {}
  ],
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**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/client/subdomains
```

---

<a id="post-api-v1-client-subdomains"></a>
#### `POST /api/v1/client/subdomains`

*Create subdomain (client)*

Create a subdomain for the authenticated client account. Plan limit enforced.

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `document_root` | string | no | — |
| `parent_domain` | string | yes | — |
| `php_version` | string | no | — |
| `subdomain` | string | yes | — |

**Request body example:**

```json
{
  "document_root": "string",
  "parent_domain": "example.com",
  "php_version": "string",
  "subdomain": "example.com"
}
```

**Responses:**

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

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X POST \
  -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/client/subdomains
```

---

<a id="delete-api-v1-client-subdomains-subdomain"></a>
#### `DELETE /api/v1/client/subdomains/{subdomain}`

*Delete subdomain (client)*

Delete a subdomain owned by the authenticated client account; its own folder under the home directory is renamed <folder>-removed-<timestamp> (nothing is deleted).

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `subdomain` | string | yes | — |

**Responses:**

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

**Response example (200):**

```json
{
  "message": "string",
  "status": "success"
}
```

**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/client/subdomains/{subdomain}
```

---

<a id="put-api-v1-client-subdomains-subdomain"></a>
#### `PUT /api/v1/client/subdomains/{subdomain}`

*Update subdomain (client)*

Update a subdomain owned by the authenticated client account.

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `subdomain` | string | yes | — |

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `document_root` | string | no | — |
| `php_version` | string | no | — |
| `subdomain` | string | no | — |

**Request body example:**

```json
{
  "document_root": "string",
  "php_version": "string",
  "subdomain": "string"
}
```

**Responses:**

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

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**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/client/subdomains/{subdomain}
```

---
