> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inferwall.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Admin API: Reload, Stats, and Config Endpoints

> Admin-only endpoints to hot-reload config, view request statistics, and read runtime settings. Requires the admin API key (iwk_admin_ prefix).

The admin endpoints give you operational control over a running InferenceWall instance: hot-reload configuration without downtime, view request statistics, and inspect the active runtime settings.

<Warning>
  All admin endpoints require the admin API key (`iwk_admin_` prefix). Requests made with a scan key return `401 Unauthorized`.
</Warning>

***

## POST /v1/admin/reload

Hot-reload signatures and policies from disk without restarting the server. Use this after adding custom signatures or changing your policy file — changes take effect immediately.

### Example

```bash theme={null}
curl -X POST http://localhost:8000/v1/admin/reload \
  -H "Authorization: Bearer iwk_admin_YOUR_KEY"
```

```json theme={null}
{
  "status": "ok",
  "signature_count": 102,
  "message": "Signatures and policies reloaded successfully."
}
```

<Tip>
  After calling `/v1/admin/reload`, confirm the changes by calling `GET /v1/signatures` to verify your new signatures appear, or `GET /v1/policies` to verify threshold changes.
</Tip>

***

## GET /v1/admin/stats

Retrieve system statistics for the running instance, including request counts, decision distribution, and block rates.

### Example

```bash theme={null}
curl http://localhost:8000/v1/admin/stats \
  -H "Authorization: Bearer iwk_admin_YOUR_KEY"
```

```json theme={null}
{
  "requests_total": 48210,
  "decisions": {
    "allow": 46503,
    "flag": 1291,
    "block": 416
  },
  "block_rate": 0.0086,
  "uptime_secs": 86400
}
```

### Response fields

<ResponseField name="requests_total" type="number">
  Total number of scan requests processed since the server started.
</ResponseField>

<ResponseField name="decisions" type="object">
  Breakdown of decisions by verdict.

  <Expandable title="decisions properties">
    <ResponseField name="allow" type="number">
      Number of requests that received an `allow` decision.
    </ResponseField>

    <ResponseField name="flag" type="number">
      Number of requests that received a `flag` decision.
    </ResponseField>

    <ResponseField name="block" type="number">
      Number of requests that received a `block` decision.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="block_rate" type="number">
  Fraction of all requests that resulted in a `block` decision (0.0–1.0).
</ResponseField>

<ResponseField name="uptime_secs" type="number">
  Server uptime in seconds since the last start.
</ResponseField>

***

## GET /v1/config

Read the active runtime configuration, including environment variable values and resolved settings.

### Example

```bash theme={null}
curl http://localhost:8000/v1/config \
  -H "Authorization: Bearer iwk_admin_YOUR_KEY"
```

```json theme={null}
{
  "host": "0.0.0.0",
  "port": 8000,
  "profile": "standard",
  "log_level": "info",
  "tls": "off",
  "signatures_dir": "/home/user/.inferwall/signatures",
  "policy_path": "/home/user/.inferwall/policies/my-policy.yaml",
  "redis_url": null
}
```

### Response fields

<ResponseField name="host" type="string">
  The host address InferenceWall is bound to (`IW_HOST`).
</ResponseField>

<ResponseField name="port" type="number">
  The port InferenceWall is listening on (`IW_PORT`).
</ResponseField>

<ResponseField name="profile" type="string">
  The active deployment profile: `lite`, `standard`, or `full` (`IW_PROFILE`).
</ResponseField>

<ResponseField name="log_level" type="string">
  The active log level (`IW_LOG_LEVEL`).
</ResponseField>

<ResponseField name="tls" type="string">
  TLS mode: `auto`, `off`, or a path to a certificate (`IW_TLS`).
</ResponseField>

<ResponseField name="signatures_dir" type="string">
  Resolved path to the custom signatures directory (`IW_SIGNATURES_DIR`).
</ResponseField>

<ResponseField name="policy_path" type="string">
  Resolved path to the active policy file (`IW_POLICY_PATH`).
</ResponseField>

<ResponseField name="redis_url" type="string">
  Redis URL for distributed sessions, or `null` if not configured (`IW_REDIS_URL`).
</ResponseField>
