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

Get the domain's current subscription

gethttps://api.nsin.ir/domains/{domain}/subscription

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

The domain's current subscription itself, with its entitlements (effective_features), the current traffic-allowance window and the traffic used in it (quota_period_used_bytes). null when the domain has no subscription. Readable by every member of the domain, not only those with billing. For its statement, invoices and wallet movements use GET /domains/{domain}/subscriptions/{id}.

Path parameters

  • domainstringrequiredpath

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

Responses

200Current subscription, or null.

Content type: application/json

  • Option 1null
  • Option 2Subscription

    A plan attached to one domain. Entitlements are not read from the plan directly — use GET /domains/{domain}/features, which resolves any per-subscription overrides.

    Fields
    • idinteger
    • user_idinteger
    • domain_idinteger
    • domain_namestring
    • plan_idinteger

      The plan this subscription is on.

    • planobject

      The plan this subscription is on.

    • plan_term_idinteger

      The billing term purchased.

    • plan_termobject

      The billing term purchased.

    • statusstring

      For example active, expired, grace or cancelled.

    • started_atstring (date-time)

      Start of the subscription term.

    • expires_atstring (date-time)

      End of the paid term.

    • grace_untilstring (date-time)

      End of the grace period after expiry, during which the plan keeps working.

    • auto_renewboolean

      Renew from the wallet at expiry.

    • quota_reset_daysinteger

      Traffic-allowance reset cadence, frozen at purchase time so later plan changes cannot shift an existing subscriber's quota window.

    • is_trialboolean

      The free trial granted at signup. Downgrades to the free plan on expiry rather than entering grace.

    • cancelled_atstring (date-time)

      When the subscription was cancelled. Absent unless cancelled.

    • cancel_reasonstring

      Why NSIN cancelled it, for a cancellation the system made. Absent otherwise.

      One of: "domain_deleted" "recycled_domain_id" "plan_switch" "trial_ended"
    • created_atstring (date-time)
    • updated_atstring (date-time)
    • effective_featuresobject

      The entitlements this subscription carries — its plan with any overrides applied. On single-subscription reads.

    • quota_period_startstring (date-time)

      Start of the current traffic-allowance window. On single-subscription reads of an active or grace subscription.

    • quota_period_endstring (date-time)

      End of the current traffic-allowance window.

    • quota_period_used_bytesinteger (int64)

      Traffic used so far in the current allowance window, in bytes. Only on GET /domains/{domain}/subscription.

    • override_max_recordsinteger

      Support-set override of the plan's max_records. Present only when set.

    • override_max_traffic_gbinteger

      Support-set override of the plan's max_traffic_gb. Present only when set.

    • override_max_rules_per_setinteger

      Support-set override of the plan's max_rules_per_set. Present only when set.

    • override_max_gateway_requests_30dinteger

      Support-set override of the plan's max_gateway_requests_30d. Present only when set.

    • override_max_gateway_gb_30dinteger

      Support-set override of the plan's max_gateway_gb_30d. Present only when set.

    • override_max_cache_cap_mbinteger

      Support-set override of the plan's max_cache_cap_mb. Present only when set.

    • override_max_cache_disk_gbinteger

      Support-set override of the plan's max_cache_disk_gb. Present only when set.

    • override_max_cache_ttl_daysinteger

      Support-set override of the plan's max_cache_ttl_days. Present only when set.

    • override_max_email_rulesinteger

      Support-set override of the plan's max_email_rules. Present only when set.

    • override_max_email_forwards_per_dayinteger

      Support-set override of the plan's max_email_forwards_per_day. Present only when set.

    • override_max_email_sends_per_dayinteger

      Support-set override of the plan's max_email_sends_per_day. Present only when set.

    • override_max_custom_rulesinteger

      Support-set override of the plan's max_custom_rules. Present only when set.

    • override_disabled_rule_typesstring

      Support-set override of the plan's disabled_rule_types, as a JSON array in a string ([] lifts every restriction). Present only when set.

    • override_gateways_enabledboolean

      Support-set override of the plan's gateways_enabled. Present only when set.

    • override_logs_enabledboolean

      Support-set override of the plan's logs_enabled. Present only when set.

    • override_monitoring_enabledboolean

      Support-set override of the plan's monitoring_enabled. Present only when set.

    • override_rules_enabledboolean

      Support-set override of the plan's rules_enabled. Present only when set.

    • override_cache_purge_enabledboolean

      Support-set override of the plan's cache_purge_enabled. Present only when set.

    • override_custom_ssl_enabledboolean

      Support-set override of the plan's custom_ssl_enabled. Present only when set.

    • override_ws_enabledboolean

      Support-set override of the plan's ws_enabled. Present only when set.

    • override_host_header_edit_enabledboolean

      Support-set override of the plan's host_header_edit_enabled. Present only when set.

    • override_uptime_sms_enabledboolean

      Support-set override of the plan's uptime_sms_enabled. Present only when set.

    • override_dedicated_support_enabledboolean

      Support-set override of the plan's dedicated_support_enabled. Present only when set.

    • override_shield_enabledboolean

      Support-set override of the plan's shield_enabled. Present only when set.

    • override_bot_cache_enabledboolean

      Support-set override of the plan's bot_cache_enabled. Present only when set.

    • override_under_attack_allowedboolean

      Support-set override of the plan's under_attack_allowed. Present only when set.

    • override_email_routing_enabledboolean

      Support-set override of the plan's email_routing_enabled. Present only when set.

    • override_email_sending_enabledboolean

      Support-set override of the plan's email_sending_enabled. Present only when set.

json
"string"
400Missing domain.

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "read-only API key"
}
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"
}
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 GET "https://api.nsin.ir/domains/example.com/subscription" \
  -H "Authorization: Bearer $NSIN_API_KEY"
esc