# Client — SSL

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

*List SSL certificates (client)*

Return SSL certificate status for all domains owned by the authenticated client.

**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/ssl
```

---

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

*Delete SSL certificate (client)*

Delete the SSL certificate for a domain owned by the authenticated client and disable HTTPS on the vhost.

**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/ssl/{domain}
```

---

<a id="get-api-v1-client-ssl-domain"></a>
#### `GET /api/v1/client/ssl/{domain}`

*Get SSL certificate (client)*

Return SSL certificate metadata for a specific domain owned by the authenticated client.

**Path parameters:**

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

**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 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/ssl/{domain}
```

---

<a id="post-api-v1-client-ssl-domain-custom"></a>
#### `POST /api/v1/client/ssl/{domain}/custom`

*Upload custom SSL certificate (client)*

Upload a custom SSL certificate (cert + key + optional chain) for a domain owned by the authenticated client.

**Path parameters:**

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

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `ca_bundle` | string | no | — |
| `certificate` | string | yes | minLength=1; maxLength=65536 |
| `force` | boolean | no | default `False` |
| `private_key` | string | yes | minLength=1; maxLength=65536 |

**Request body example:**

```json
{
  "ca_bundle": "string",
  "certificate": "string",
  "force": false,
  "private_key": "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/ssl/{domain}/custom
```

---

<a id="post-api-v1-client-ssl-domain-letsencrypt"></a>
#### `POST /api/v1/client/ssl/{domain}/letsencrypt`

*Request Let's Encrypt certificate (client)*

Issue or renew a Let's Encrypt certificate for a domain owned by the authenticated client.

**Path parameters:**

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

**Request body example:**

```json
{
  "force": false,
  "force_renew": false
}
```

**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/ssl/{domain}/letsencrypt
```

---
