# Client — File Manager

<a id="delete-api-v1-client-files"></a>
#### `DELETE /api/v1/client/files`

*Delete file*

Delete a single file or directory for the authenticated client account.

**Query parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `path` | string | no | — |

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

---

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

*List files*

List files and directories under the authenticated client's home tree.

**Query parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `path` | string | no | — |
| `show_hidden` | boolean | no | — |

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

---

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

*Create file or directory*

Create a new file or directory for the authenticated client account.

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `content` | string | no | — |
| `path` | string | yes | — |
| `type` | string | no | default `file`; enum: `file`, `directory` |

**Request body example:**

```json
{
  "content": "string",
  "path": "string",
  "type": "file"
}
```

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

---

<a id="put-api-v1-client-files"></a>
#### `PUT /api/v1/client/files`

*Edit file*

Overwrite a file's content for the authenticated client account.

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `content` | string | yes | — |
| `create_backup` | boolean | no | default `False` |
| `encoding` | string | no | default `utf-8`; enum: `utf-8`, `latin-1` |
| `path` | string | yes | — |

**Request body example:**

```json
{
  "content": "string",
  "create_backup": false,
  "encoding": "utf-8",
  "path": "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/files
```

---

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

*Compress files*

Compress one or more paths into a tar.gz or zip archive for the authenticated client account.

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `destination` | string | yes | — |
| `format` | string | no | default `tar.gz` |
| `paths` | array<string> | yes | — |

**Request body example:**

```json
{
  "destination": "string",
  "format": "tar.gz",
  "paths": [
    "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/files/compress
```

---

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

*Read file content*

Return the textual content and metadata of a file owned by the authenticated client.

**Query parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `path` | 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/files/content
```

---

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

*Copy file*

Copy a file or directory (single or batch) for the authenticated client account.

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `destination` | string | yes | — |
| `overwrite` | boolean | no | default `False` |
| `source` | string | no | — |
| `sources` | array<string> | no | — |

**Request body example:**

```json
{
  "destination": "string",
  "overwrite": false,
  "source": "string",
  "sources": [
    "string"
  ]
}
```

**Responses:**

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

**Response example (200):**

```json
{
  "data": null,
  "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/files/copy
```

---

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

*Batch delete*

Delete multiple files or directories in one request for the authenticated client account.

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `paths` | array<string> | yes | — |

**Request body example:**

```json
{
  "paths": [
    "string"
  ]
}
```

**Responses:**

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

**Response example (200):**

```json
{
  "data": null,
  "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/files/delete
```

---

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

*Client Download File*

Download a file for the authenticated client account.

**Query parameters:**

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

**Responses:**

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

**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/files/download
```

---

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

*Extract archive*

Extract a tar/zip archive into the authenticated client's home tree.

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `destination` | string | no | default `.` |
| `path` | string | yes | — |

**Request body example:**

```json
{
  "destination": ".",
  "path": "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/files/extract
```

---

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

*File info*

Return detailed file/directory metadata for a path owned by the authenticated client.

**Query parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `path` | 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/files/info
```

---

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

*Move file*

Move/rename a file or directory (single or batch) for the authenticated client account.

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `destination` | string | yes | — |
| `overwrite` | boolean | no | default `False` |
| `source` | string | no | — |
| `sources` | array<string> | no | — |

**Request body example:**

```json
{
  "destination": "string",
  "overwrite": false,
  "source": "string",
  "sources": [
    "string"
  ]
}
```

**Responses:**

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

**Response example (200):**

```json
{
  "data": null,
  "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/files/move
```

---

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

*Set permissions*

Change file or directory permissions for the authenticated client account.

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `mode` | string | yes | — |
| `path` | string | yes | — |
| `recursive` | boolean | no | default `False` |

**Request body example:**

```json
{
  "mode": "string",
  "path": "string",
  "recursive": 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/files/permissions
```

---

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

*Search files*

Search the authenticated client's home tree by filename, extension, or file content.

**Query parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `query` | string | no | — |
| `path` | string | no | — |
| `type` | string | no | — |
| `extension` | string | no | — |
| `case_sensitive` | boolean | no | — |
| `max_depth` | integer | no | minimum=1; maximum=50 |
| `content_query` | string | no | — |

**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/files/search
```

---

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

*Upload file*

Upload a single file (multipart/form-data) for the authenticated client account.

**Query parameters:**

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

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `file` | string | yes | — |

**Request body example:**

```json
{
  "file": "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/files/upload
```

---
