WAF Customer API
The customer API manages the sites of your own Web Protection account.
Connect
- Address:
https://waf.wireshield.network/api/v1 - Token: open the WAF panel from WS Portal (My Services → Manage WAF), then API Settings, then create a key. It starts with
wsapi_and is shown once. A key made by a customer account opens only the customer API. - Header:
Authorization: Bearer wsapi_…
curl https://waf.wireshield.network/api/v1/domains -H "Authorization: Bearer wsapi_..."
Requests and answers are JSON. Times are ISO 8601, UTC. An error is an HTTP status and {"detail": "..."}. Look at the status code in your program, because the message text can change.
| Code | Meaning |
|---|---|
400 | A value is not valid, or a limit is reached (for example the number of sites of your plan) |
401 | The key is missing, wrong or the account is switched off |
403 | This key may not do that, or your plan does not have the feature |
404 | It does not exist, or it is not yours |
422 | The body does not match: the detail names the field |
Sites
POST /domains
Adds a site. It checks your plan's limit of sites.
| Field | Type | Required | Meaning |
|---|---|---|---|
domain | string | yes | The domain name |
backend_address | string | yes | The origin server (IP or name) |
backend_port | int | no | Default 80 |
POST /api/v1/domains
{"domain": "blog.example.com", "backend_address": "203.0.113.20", "backend_port": 80}
The answer has the site's id, domain, is_active, waf_enabled, ssl_status and created_at.
GET /domains and GET /domains/{id}
List your sites, or read one.
DELETE /domains/{id}
Deletes a site.
Origin servers
| Call | What it does |
|---|---|
GET /domains/{id}/backends | Lists the origin servers of a site |
POST /domains/{id}/backends | Adds one: address (IP or name), port (1–65535), weight (1–100) |
DELETE /domains/{id}/backends/{backend_id} | Removes one. The last server cannot be removed |
Challenge and WAF
| Call | What it does |
|---|---|
GET /domains/{id}/challenge | The default challenge of the site and the choices |
PUT /domains/{id}/challenge | Body {"default_challenge": "none" | "js_challenge" | "captcha"} |
PUT /domains/{id}/waf?enabled=true | Switches the protection on (false = off) |
curl -X PUT "https://waf.wireshield.network/api/v1/domains/$DOMAIN_ID/challenge" \
-H "Authorization: Bearer $WAF_KEY" -H "Content-Type: application/json" \
-d '{"default_challenge": "js_challenge"}'
The reseller API has more calls for sites (DNS check, certificates, locations). See WAF Reseller API.