Purge the entire cache for a domain
const url = 'https://api.nsin.ir/domains/example.com/cache/';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://api.nsin.ir/domains/example.com/cache/ \ --header 'Authorization: Bearer <token>'Removes every cached entry for the domain, on every storage node.
The sweep runs in the background: a 202 means it was queued and
deleted is not yet known. It is only accepted when every storage
node can be reached — otherwise nothing is purged and the answer is
503 naming what is unreachable, so a region never keeps serving a
copy you were told was gone. Requires cache.edit and a plan including
cache purge.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The domain name (for example example.com) — not a numeric id.
Example
example.comResponses
Section titled “ Responses ”Nothing to purge — the domain has no cached hostnames.
object
Entries removed. 0 while a background sweep is still running.
The purge was queued to run in the background, so deleted is not yet known.
On a refused purge, what could not be reached and why.
On a refused purge, the explanation to show.
Example generated
{ "deleted": 1, "accepted": true, "unreached": [ "example" ], "error": "example"}Purge queued; it runs in the background.
object
Entries removed. 0 while a background sweep is still running.
The purge was queued to run in the background, so deleted is not yet known.
On a refused purge, what could not be reached and why.
On a refused purge, the explanation to show.
Example generated
{ "deleted": 1, "accepted": true, "unreached": [ "example" ], "error": "example"}Missing, malformed, revoked or expired API key. (A valid key whose
account has been deactivated gets 403 account is inactive instead.)
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "invalid API key"}The domain has no active plan.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}Read-only key, your role on the domain lacks cache.edit, or cache purge is not on the domain’s plan.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}The domain is disabled.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}The key exceeded its request budget (300 requests per minute by default).
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "rate limit exceeded"}Part of the cache storage fleet cannot be reached. Nothing was
purged; unreached says what and why. Try again shortly.
object
Entries removed. 0 while a background sweep is still running.
The purge was queued to run in the background, so deleted is not yet known.
On a refused purge, what could not be reached and why.
On a refused purge, the explanation to show.
Example generated
{ "deleted": 1, "accepted": true, "unreached": [ "example" ], "error": "example"}