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.
The sweep runs in the background: a 202 means it was queued and
deleted is not yet known. 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 ”Purge completed synchronously — nothing was cached.
object
The purge was queued to run in the background, so deleted is not yet known.
Example generated
{ "deleted": 1, "accepted": true}Purge queued; it runs in the background.
object
The purge was queued to run in the background, so deleted is not yet known.
Example generated
{ "deleted": 1, "accepted": true}Missing, malformed, revoked or expired API key — or the owning account is inactive.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "invalid API key"}Read-only key, insufficient role, or cache purge is not on the 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"}