# Client — FTP

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

*List FTP accounts (client)*

Return all FTP accounts 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/ftp
```

---

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

*Create FTP account (client)*

Create a new FTP account under the authenticated client. Plan limit enforced server-side.

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `directory` | string | no | default `/`; minLength=1; maxLength=255; pattern=`^/[a-zA-Z0-9/_.\-]*$` |
| `password` | string | yes | minLength=8; maxLength=128 |
| `quota_mb` | integer | no | default `0`; minimum=0.0; maximum=999999.0 |
| `username` | string | yes | minLength=1; maxLength=32 |

**Request body example:**

```json
{
  "directory": "/",
  "password": "REPLACE_ME",
  "quota_mb": 0,
  "username": "alice"
}
```

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

---

<a id="delete-api-v1-client-ftp-ftp-user"></a>
#### `DELETE /api/v1/client/ftp/{ftp_user}`

*Delete FTP account (client)*

Delete an FTP account owned by the authenticated client.

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `ftp_user` | 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/ftp/{ftp_user}
```

---

<a id="put-api-v1-client-ftp-ftp-user"></a>
#### `PUT /api/v1/client/ftp/{ftp_user}`

*Update FTP account (client)*

Update an FTP account (password, directory, or quota) owned by the authenticated client. Fields equal to the stored values are not a change; a request that changes nothing writes no audit entry.

**Path parameters:**

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

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `directory` | string | no | — |
| `password` | string | no | — |
| `quota_mb` | integer | no | — |

**Request body example:**

```json
{
  "directory": "string",
  "password": "string",
  "quota_mb": 0
}
```

**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/ftp/{ftp_user}
```

---
