Blocks a client without deleting it. The peer remains in the server config, keys stay intact, and AllowedIPs is set to 0.0.0.0/32.
Request Parameters
| Name | Required | Validation | Description |
network_wg | Yes | ^\d{1,5}$ | Network suffix. Example: 0 maps to wg0. |
client_name | Yes | ^[A-Za-z0-9_.-]{1,64}$ | Existing client name to block. |
Checks Before Block
- The network config must exist.
- The client marker must exist exactly.
Request Example
curl -H "Authorization: Bearer <API_TOKEN>" \
"https://wgvpnapi.tdimpact.app:5530/block?network_wg=0&client_name=client1"
Success Response
{
"success": true,
"status": "blocked",
"network": "wg0",
"user": "client1",
"original_allowed_ips": "10.100.0.80/32",
"output": ["SUCCESS", "Status=blocked", "OriginalAllowedIPs=10.100.0.80/32"]
}
Blocking an already blocked client is idempotent and returns success if saved original state exists.