Skip to content

Access, bans and lists API Since v0.1 ​

Bans take effect on every node that shares the ban store. Lists are named lists used by access rules. For the keys, see Access, rate limits, bans and identity.

For the base URL, sign-in, roles and error format, see Management API. Except sign-in, a route answers 401 without credentials and 403 when the role is too low.

Routes ​

Bans ​

MethodPathMinimum roleWhat it doesMain fields
GET/v1/bansviewer, all applicationsLists active bans.none
POST/v1/bansoperator, all applicationsBans a client address.Body: client (IP), for (duration, at most 720h), reason.
DELETE/v1/bans/{client}operator, all applicationsLifts a ban.none

Lists and rules ​

MethodPathMinimum roleWhat it doesMain fields
GET/v1/listsviewerLists every named list with its source and size.none
GET/v1/apps/{name}/rules/{list}viewerReturns one access rule list of an application.Returns the current values with base_version.
PUT/v1/apps/{name}/rules/{list}operatorReplaces one access rule list of an application.Body: items (the whole list; [] removes it), base_version, comment, dry_run.
GET/v1/config/lists/{list}viewer, all applicationsReturns one global list.Returns the current values with base_version.
PUT/v1/config/lists/{list}operator, all applicationsReplaces one global list.Body: items (the whole list; [] removes it), base_version, comment, dry_run.
GET/v1/geoip Since v0.2viewerReturns the geolocation database status and attribution.none

Rate-limit suggestions ​

MethodPathMinimum roleWhat it doesMain fields
GET/v1/apps/{name}/ratelimit/suggestions Since v0.2viewerLists suggested rate limits.none
POST/v1/apps/{name}/ratelimit/suggestions/run Since v0.2operatorComputes new suggestions from recent traffic.none
POST/v1/apps/{name}/ratelimit/suggestions/{id}/accept Since v0.2operatorAccepts a suggestion into the configuration.Body: base_version, comment.
POST/v1/apps/{name}/ratelimit/suggestions/{id}/reject Since v0.2operatorRejects a suggestion.none

Identity ​

MethodPathMinimum roleWhat it doesMain fields
GET/v1/apps/{name}/identity Since v0.2viewerReturns identity (token and session recognition) settings.Returns the current values with base_version.
PUT/v1/apps/{name}/identity Since v0.2operatorChanges identity settings.Body: set (key to value; empty string resets the key), base_version (required), comment, dry_run.
POST/v1/apps/{name}/identity/test Since v0.2viewerTests which consumer a sample request resolves to. Viewers see masked labels.Body: ip, headers, cookies, path, consumer, consumer_kind, claims.
POST/v1/apps/{name}/identity/rotate-key Since v0.2operatorRotates the identity signing key.none

File lists and ICAP servers ​

MethodPathMinimum roleWhat it doesMain fields
GET/v1/file-listsviewerLists downloadable file-type lists.none
PUT/v1/file-listsoperator, all applicationsReplaces the file-type list definitions.Body: items (the whole list; [] removes it), base_version, comment, dry_run.
POST/v1/file-lists/{name}/refreshoperator, all applicationsDownloads a file-type list now.none
GET/v1/icap-serversviewerLists antivirus (ICAP) servers.none
PUT/v1/icap-serversadmin, all applicationsReplaces the ICAP server definitions.Body: items (the whole list; [] removes it), base_version, comment, dry_run.
POST/v1/icap-servers/{name}/testadmin, all applicationsConnects to an ICAP server and reports the result.none
PUT/v1/icap-servers/{name}/caadmin, all applicationsSets the CA certificate for an ICAP server.Body: ca (PEM), base_version, comment, dry_run.
PUT/v1/icap-servers/{name}/client-certificateadmin, all applicationsSets the client certificate and key for an ICAP server.Body: cert, key, base_version, comment, dry_run.

Example ​

sh
curl -sk -X POST -H "Authorization: Bearer waap_EXAMPLE" -H "Content-Type: application/json" -d '{"client":"203.0.113.7","for":"1h","reason":"scanner"}' https://127.0.0.1:9443/v1/bans