Skip to content
nsin docs

Purge the entire cache for a domain

DELETE
/domains/{domain}/cache/
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.

domain
required
string

The domain name (for example example.com) — not a numeric id.

Example
example.com

Nothing to purge — the domain has no cached hostnames.

Media type application/json
object
deleted

Entries removed. 0 while a background sweep is still running.

integer
accepted

The purge was queued to run in the background, so deleted is not yet known.

boolean
unreached

On a refused purge, what could not be reached and why.

Array<string>
error

On a refused purge, the explanation to show.

string
Example generated
{
"deleted": 1,
"accepted": true,
"unreached": [
"example"
],
"error": "example"
}

Purge queued; it runs in the background.

Media type application/json
object
deleted

Entries removed. 0 while a background sweep is still running.

integer
accepted

The purge was queued to run in the background, so deleted is not yet known.

boolean
unreached

On a refused purge, what could not be reached and why.

Array<string>
error

On a refused purge, the explanation to show.

string
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.)

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example invalidKey
{
"error": "invalid API key"
}

The domain has no active plan.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
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.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
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.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

The domain is disabled.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

The key exceeded its request budget (300 requests per minute by default).

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example limited
{
"error": "rate limit exceeded"
}

Part of the cache storage fleet cannot be reached. Nothing was purged; unreached says what and why. Try again shortly.

Media type application/json
object
deleted

Entries removed. 0 while a background sweep is still running.

integer
accepted

The purge was queued to run in the background, so deleted is not yet known.

boolean
unreached

On a refused purge, what could not be reached and why.

Array<string>
error

On a refused purge, the explanation to show.

string
Example generated
{
"deleted": 1,
"accepted": true,
"unreached": [
"example"
],
"error": "example"
}