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

Delete a header rule

deletehttps://api.nsin.ir/domains/{domain}/rules/header/{ruleId}

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

Deletes one header rule and removes it from the edge immediately. A rule that does not exist, belongs to another domain or to another rule type answers 404, as does a caller without rules.edit. Requires rules.edit.

Path parameters

  • domainstringrequiredpath

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

  • ruleIdintegerrequiredpath

    Numeric id of the rule.

Responses

200Deleted.

Content type: application/json

  • messagestring
json
{
  "message": "deleted"
}
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"
}
403The key is read-only and this endpoint is a write. Read-only keys may only issue GET, HEAD and OPTIONS.

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "read-only API key"
}
404The domain or the rule does not exist, the rule belongs to another domain or another rule type, or your role does not permit this operation.

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"
}

Example request

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