The syntax for purging a service through the API can be found in the Purging section of the API documentation.
WARNING
We recommend that all customers enable authentication for URL purge requests via API.
When you purge using the API, the purge ID is returned in the response. For example:
1
{"status": "ok", "id": "1234567890"}
If the purge isn't working, send an email to support@fastly.com with the purge ID, the resource you're attempting to purge, and the type of purge (e.g., purge by surrogate key through the API).