nsindocs Search the docs⌘K
  1. Docs
  2. API reference
  3. Cache

Purge the entire cache for a domain

deletehttps://api.nsin.ir/domains/{domain}/cache/

Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.

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.

Path parameters

  • domainstringrequiredpath

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

Responses

200Nothing to purge — the domain has no cached hostnames.

Content type: application/json

  • deletedinteger

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

  • acceptedboolean

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

  • unreachedarray of string

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

  • errorstring

    On a refused purge, the explanation to show.

json
{
  "deleted": 0,
  "accepted": true,
  "unreached": [
    "string"
  ],
  "error": "string"
}
202Purge queued; it runs in the background.

Content type: application/json

  • deletedinteger

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

  • acceptedboolean

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

  • unreachedarray of string

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

  • errorstring

    On a refused purge, the explanation to show.

json
{
  "deleted": 0,
  "accepted": true,
  "unreached": [
    "string"
  ],
  "error": "string"
}
401Missing, malformed, revoked or expired API key. (A valid key whose account has been deactivated gets 403 account is inactive instead.)

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "invalid API key"
}
402The domain has no active plan.

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "read-only API key"
}
403Read-only key, your role on the domain lacks cache.edit, or cache purge is not on the domain's plan.

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "read-only API key"
}
404No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "read-only API key"
}
409The domain is disabled.

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "read-only API key"
}
429The key exceeded its request budget (300 requests per minute by default).

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "rate limit exceeded"
}
503Part of the cache storage fleet cannot be reached. Nothing was purged; unreached says what and why. Try again shortly.

Content type: application/json

  • deletedinteger

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

  • acceptedboolean

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

  • unreachedarray of string

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

  • errorstring

    On a refused purge, the explanation to show.

json
{
  "deleted": 0,
  "accepted": true,
  "unreached": [
    "string"
  ],
  "error": "string"
}

Example request

bash
curl -X DELETE "https://api.nsin.ir/domains/example.com/cache/" \
  -H "Authorization: Bearer $NSIN_API_KEY"
esc