AS216394 · WireShield

Documentation

Setup, connection and day-to-day operations guides.

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.

CodeMeaning
400A value is not valid, or a limit is reached (for example the number of sites of your plan)
401The key is missing, wrong or the account is switched off
403This key may not do that, or your plan does not have the feature
404It does not exist, or it is not yours
422The body does not match: the detail names the field

Sites

POST /domains

Adds a site. It checks your plan's limit of sites.

FieldTypeRequiredMeaning
domainstringyesThe domain name
backend_addressstringyesThe origin server (IP or name)
backend_portintnoDefault 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

CallWhat it does
GET /domains/{id}/backendsLists the origin servers of a site
POST /domains/{id}/backendsAdds 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

CallWhat it does
GET /domains/{id}/challengeThe default challenge of the site and the choices
PUT /domains/{id}/challengeBody {"default_challenge": "none" | "js_challenge" | "captcha"}
PUT /domains/{id}/waf?enabled=trueSwitches 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.

Still have a question about this guide?
Ask our technical team