AS216394 · WireShield

Documentation

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

WAF Reseller API

The reseller API manages many customers of Web Protection from your own portal or billing system. You see only the customers you created. Reseller accounts are issued by WireShield on request: contact us.

Connect

  • Address: https://waf.wireshield.network/api/v1
  • Token: in the reseller panel, API Settings. It starts with wsapi_ and is shown once.
  • Header: Authorization: Bearer wsapi_…
  • Errors, limits and formats are the same as in the WAF Customer API. null for a limit means unlimited, 0 means none.

A typical flow

  1. Sale: POST /customers with a plan, then POST /customers/{id}/domains. The answer has a dns target to show to the customer.
  2. DNS: the customer changes their DNS. GET /customers/{id}/domains/{domain_id}/dns-check tells when it arrived; the certificate is then issued by itself (or ask with POST …/ssl).
  3. Sign in: POST /customers/{id}/login-link returns a one-time address (valid 15 minutes) that opens the WAF panel without a password. Make it at the moment of the click.
  4. Billing: at month end GET /usage?month=YYYY-MM.
  5. Unpaid: POST /customers/{id}/suspend, and …/unsuspend when paid. DELETE /customers/{id} ends the service (?permanent=true deletes everything).

Plans and customers

CallWhat it does
GET /plansThe plans you can give, with limits (sites, custom_rules, rate_limit_rules, captcha_monthly, captcha_keys) and features
POST /customersCreates a customer: email, name, plan_id, optional password or send_invite
GET /customers, GET /customers/{id}Lists, reads
PUT /customers/{id}Changes the plan ({"plan_id": "…"}) and limits. The account stays the same and its keys are kept
DELETE /customers/{id}Ends the service
POST /customers/{id}/login-linkOne-time sign-in address
POST /customers/{id}/suspend · unsuspendSwitches the customer off / on
POST /api/v1/customers

{"email": "ali@example.com", "name": "Example Ltd", "plan_id": "f980842a-e67c-4d9a-9456-65e4f6ffdc95", "send_invite": false}

An e-mail address can have only one account in the WAF panel. A customer who already has an account made outside your reseller cannot be created again: ask us to move that account under yours.

Sites of a customer

CallWhat it does
GET /customers/{id}/locationsLocations the plan allows to choose (enabled: false = the best node is used)
POST /customers/{id}/domainsAdds a site: domain, optional backend_servers (address, port, weight), location_id, www_redirect (none, www_to_main, main_to_www). The answer has dns
GET /customers/{id}/domains, …/{domain_id}Lists, reads
GET …/{domain_id}/dns-checkHas the DNS arrived
POST …/{domain_id}/sslAsks for the certificate now
POST …/{domain_id}/backends, DELETE …/backends/{backend_id}Origin servers (up to 20)
PUT …/{domain_id}/waf?enabled=trueProtection on / off
DELETE …/{domain_id}Deletes the site

Usage

GET /usage?month=YYYY-MM returns every customer of the month in one call: plan, number of sites, traffic (requests, blocked, challenged, bytes) and captcha_verifications. GET /customers/{id}/usage is the same for one customer.

wsCAPTCHA

CallWhat it does
GET /customers/{id}/captchaKeys and this month's use against the plan
POST /customers/{id}/captcha/keysCreates a key (name, domains). The answer has the site key and the secret, shown once
PUT /customers/{id}/captcha/keys/{key_id}Changes name, domains, on/off
POST /customers/{id}/captcha/keys/{key_id}/secretMakes a new secret
GET …/{key_id}/stats?period=24h or 7dCounts
GET …/{key_id}/events?limit=100Verification log
DELETE …/{key_id}Deletes the key

The check itself is described in the wsCAPTCHA integration guide.

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