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

Update the catch-all

puthttps://api.nsin.ir/domains/{domain}/email-routing/catch-all

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

destination_id is required when action is forward and must be a VERIFIED destination on the domain owner's account. Requires records.edit.

Path parameters

  • domainstringrequiredpath

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

Request body

Content type: application/json · required

  • enabledboolean
  • actionstring
    One of: "forward" "drop"
  • destination_idinteger

    Required when action is forward; a verified destination on the owner's account.

Responses

200The catch-all as saved.

Content type: application/json

  • enabledboolean

    Whether the catch-all handles mail for addresses you have not created. Off, such mail is refused as an unknown user.

  • actionstring

    forward to the destination, or drop (accept and discard).

    One of: "forward" "drop"
  • destination_idinteger | null

    The destination for forward.

  • destination_emailstring | null

    That destination's address.

  • destination_verifiedboolean

    Whether the destination has confirmed its address.

json
{
  "enabled": true,
  "action": "forward",
  "destination_id": 0,
  "destination_email": "string",
  "destination_verified": true
}
400Invalid action, a missing or unverified destination, or a destination on the domain itself (code: loop).

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

  • codestring

    Machine-readable reason (hosts_not_ready, kek_unset, loop, no_mx, unverified).

  • fieldstring

    The offending body field, when one applies.

json
{
  "error": "string",
  "code": "string",
  "field": "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"
}
403The key is read-only, your role on the domain lacks the required permission, or the domain's plan does not include the feature.

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"
}
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 PUT "https://api.nsin.ir/domains/example.com/email-routing/catch-all" \
  -H "Authorization: Bearer $NSIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "enabled": true,
  "action": "forward",
  "destination_id": 0
}'
esc