Using the wao.io REST API, you can automate various tasks, like automatically invalidating or purging caches when deploying code or content.
Authentication
To use this API, you need to authenticate all requests. This works by providing the Authorization
HTTP Header along with a token provided by us.
To get this token, email us at support@wao.io. It will be valid for all sites that you've created in our dashboard previously.
Once you have the token, add it as the Authorization
header:
Authorization: Bearer myToken123
Endpoints
All API endpoints share the same basepath: https://api.wao.io/v1
A full list of all endpoints is available at https://api.wao.io/doc/, including a swagger.yml
file.
Whenever an endpoint includes a {siteId}
parameter in the URL, the endpoint refers to a specific site. You'll have to insert the side ID into the URL. To find the site ID of a specific site, browser to the site's maintenance page:

Using the Authorization
header and {siteId}
, a full request could look like this:
curl -X POST \
"https://api.wao.io/v1/sites/mySiteId123/caches?action=invalidate" \
-H "Accept: application/json" \
-H "Authorization: Bearer myToken123"
Clear caches
Simple Interface
The Simple Interface provides two ways to invalidate all caches entirely:
invalidate
the origin content, which is fast and cheap. Unchanged files like optimized images are kept.purge
(delete!) all HTTP caches and optimized assets. Images will have to be optimized again.
To invalidate content:
POST /sites/deineSiteIdABC123/caches?action=invalidate
To fully delete every cache:
POST /sites/deineSiteIdABC123/caches?action=purge
Neither request requires a request body.
If the request succeeded, the response will be a HTTP Status Code of 202
.
The actual work of invalidating or deleting caches will happen asynchronously.
Flexible Interface
The Flexible Interface can be used to invalidate specific resources in the caches:
exactMatches
invalidate exactly one resource, identified by domain, path and query componentspaths
invalidate all resources that have a matching path prefix.
To invalidate content:
POST /sites/deineSiteIdABC123/caches/invalidate
{
"domains": [ "example.net" ],
"paths": [ "/images/news", "/text/news" ],
"exactMatches": [ "/news?item=1", "/news?13" ]
}
The request body is mandatory, as is the domains
property. Both the paths
and exactMatches
properties arrays and
are optional, and can contain up to 1000 strings specifying the objects to be invalidated.
If both pathes
and exactMatches
are not specified or empty, no resources will be invalidated.
If the request was valid and accepted, the response will be a HTTP Status Code of 202
.
The actual work of invalidating or deleting caches will happen asynchronously.