API Introduction

WebSonic.io offers REST API so that you can programmatically integrate WebSonic.io in your application. Currently, we offer APIs for:

  1. Purging cache on CDN.

  2. Getting status of purge request.

Request and response encoding

All our APIs accepts JSON-encoded request bodies and returns JSON-encoded response.

Error codes

WebSonic.io API uses standard HTTP error codes.

Error code

Description

200 OK

Everything worked as expected.

400 Bad request

The request was unacceptable, often due to missing or invalid parameter(s). In this case a JSON-encoded error response is returned with the following properties:

401 Unauthorized

No valid API key provided.

429 Too many requests

Too many requests hit the API too quickly. We recommend you to throttle request rate as per the value of X-RateLimit-Limit and X-RateLimit-Reset response headers and stay within rate limits.

500, 502, 503, 504 Server error

Something went wrong with WebSonic.io API. Please create a support ticket by emailing us at developer@websonic.io.