# Logs

<a id="get-api-v1-accounts-username-logs"></a>
#### `GET /api/v1/accounts/{username}/logs`

*List Logs*

**Path parameters:**

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

**Responses:**

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

**Response example (200):**

```json
{
  "data": [
    {
      "domain": "example.com",
      "filename": "string",
      "type": "access"
    }
  ],
  "status": "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/accounts/{username}/logs
```

---

<a id="get-api-v1-accounts-username-logs-access"></a>
#### `GET /api/v1/accounts/{username}/logs/access`

*Read Access Log*

**Path parameters:**

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

**Query parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `domain` | string | yes | — |
| `lines` | integer | no | minimum=1; maximum=5000 |

**Responses:**

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

**Response example (200):**

```json
{
  "data": {
    "content": [
      "string"
    ],
    "domain": "example.com",
    "lines": 0,
    "log_type": "access"
  },
  "status": "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/accounts/{username}/logs/access
```

---

<a id="get-api-v1-accounts-username-logs-error"></a>
#### `GET /api/v1/accounts/{username}/logs/error`

*Read Error Log*

**Path parameters:**

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

**Query parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `domain` | string | yes | — |
| `lines` | integer | no | minimum=1; maximum=5000 |

**Responses:**

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

**Response example (200):**

```json
{
  "data": {
    "content": [
      "string"
    ],
    "domain": "example.com",
    "lines": 0,
    "log_type": "access"
  },
  "status": "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/accounts/{username}/logs/error
```

---

<a id="get-api-v1-accounts-username-logs-php"></a>
#### `GET /api/v1/accounts/{username}/logs/php`

*Read Php Error Log*

**Path parameters:**

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

**Query parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `lines` | integer | no | minimum=1; maximum=5000 |

**Responses:**

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

**Response example (200):**

```json
{
  "data": {
    "content": [
      "string"
    ],
    "domain": "example.com",
    "lines": 0,
    "log_type": "access"
  },
  "status": "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/accounts/{username}/logs/php
```

---
