REST API reference
NetClamp’s REST API lives at http://127.0.0.1:9845/api/v1/. Every
endpoint requires Authorization: Bearer <token> where token comes
from C:\ProgramData\NetClamp\auth.token.
Responses are JSON; errors follow RFC 7807:
{
"type": "about:blank",
"title": "Unauthorized",
"status": 401,
"detail": "invalid bearer token"
}
Health & status
| Method | Path | Description |
|---|---|---|
|
|
Health snapshot: version, wfp_active, kdrv_active, active_rules, monitored_apps, active_connections, total_blocked, uptime_since, competing_shapers, wfp_session_state, bfe_restarts. |
|
|
Per-second up/down samples over the trailing window. |
|
|
Server-Sent Events stream. Quota busts, rule sync errors, BFE bounce. |
Rules
|
|
List all rules. |
|
|
Get one rule. |
|
|
Create. Body: rule draft. |
|
|
Update. Body: rule draft. |
|
|
Delete. |
|
|
Force re-sync a |
|
|
Reconcile every rule’s sync_state against WFP. |
Rule draft schema (POST/PUT body):
{
"name": "Block Discord",
"app_path": "C:\\Path\\To\\app.exe",
"action": "BLOCK",
"direction": "BOTH",
"remote_address": "",
"remote_port": 0,
"protocol": "ANY",
"rate_limit_down_bytes_per_sec": null,
"rate_limit_up_bytes_per_sec": null,
"limit_scope": "PER_APP",
"match_mode": "EXACT_PATH",
"priority": 100,
"enabled": true
}
Quotas
|
|
List. |
|
|
Get one. |
|
|
Create. |
|
|
Update. |
|
|
Delete. |
|
|
Zero the counter. |
Licensing
|
|
License state: cap, used, baseline, bound credits. |
|
|
This machine’s HWID hash. |
|
|
Body: |
|
|
Returns an unbound token to use elsewhere. |
|
|
Body: |
|
|
Body: |
|
|
Poll for mint completion after checkout. 202 pending or 200 with token. |
|
|
Available credit packs. |
Apps & connections
|
|
Process table with cumulative up/down. |
|
|
Live socket table. |
|
|
Per-process detail. |
Configuration
|
|
Current |
|
|
Replace. Hot-reload happens automatically. |
Security (auth)
|
|
Generate a new bearer token. Old token revoked. |
Rule groups / subscriptions
|
|
List installed groups + subscriptions. |
|
|
Body: bundle JSON. |
|
|
Body: |
|
|
Uninstall a group (removes its rules + quotas). |
|
|
Force a subscription poll. |
Status codes
|
Success. |
|
Resource created. |
|
Operation queued; check the SSE stream or a |
|
Validation error. |
|
Missing or invalid bearer token. |
|
Resource doesn’t exist. |
|
Sync conflict (rule edited concurrently). Retry after reading current state. |
|
Rate limit on a billing endpoint. Honor |
|
Unexpected. Captured in |
|
WFP session torn down by BFE bounce — see Troubleshooting. |