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

Get certificate status

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

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

The domain's current certificate — issuer, validity, SANs, key size — plus whether a manual re-issue is currently allowed, and coverage: proxied hostnames that are not on the certificate yet, with their retry state.

Path parameters

  • domainstringrequiredpath

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

Responses

200Certificate status.

Content type: application/json

  • statusstring

    State of the domain's own certificate: valid, expired, pending (an order is running), failed (the last order failed; see failure_count and next_retry_at) or none (no certificate yet).

    One of: "valid" "expired" "pending" "failed" "none"
  • expires_atstring (date-time)

    End of the certificate's validity.

  • issued_atstring (date-time)

    Start of its validity.

  • days_remaininginteger

    Whole days until expiry.

  • issuerstring

    The certificate's issuer.

  • subjectstring

    The certificate's subject.

  • serial_numberstring

    Serial number, hex.

  • sansarray of string

    The names the certificate covers.

  • signature_algorithmstring

    Signature algorithm.

  • key_sizeinteger

    Public key size in bits.

  • is_wildcardboolean

    The certificate carries a wildcard name.

  • auto_renewalboolean

    Whether NSIN renews this certificate itself. True for managed-DNS domains and for external-DNS domains whose ssl_delegation is in place; false for an external-DNS domain that uploads its own.

  • has_private_keyboolean

    NSIN holds the private key, so the certificate can be served.

  • can_manual_issueboolean

    Whether POST /domains/{domain}/ssl/issue would be accepted right now.

  • manual_issue_reasonstring

    Why manual issuance is unavailable, when can_manual_issue is false.

  • next_manual_issue_atstring (date-time)

    When the next manual issue is allowed (one per hour).

  • last_issue_attempt_atstring (date-time)

    When a manual issue was last requested.

  • failure_countinteger

    Consecutive failed orders for the domain's own certificate. status flips to failed on the first one while retries continue; compare with max_retries to tell "still retrying" from "given up". Absent when nothing has failed.

  • max_retriesinteger

    How many automatic retries a failing order gets. Absent when nothing has failed.

  • next_retry_atstring (date-time)

    When the next automatic retry runs. Absent when none is scheduled.

  • last_errorstring

    Why the last order failed, in the certificate authority's words.

  • hostnamestring

    The name the reported certificate is installed under — usually the apex, but a domain may hold a certificate for one subdomain only.

  • covered_hostnamesarray of string

    Every name of this domain with an active certificate, sorted.

  • uncovered_hostnamesarray of string

    Proxied names with no certificate behind them, sorted. External-DNS domains only — for managed domains the same gaps arrive in coverage, with the retry schedule that applies when we can issue.

  • coveragearray of SslCoverageGap

    Proxied hostnames not yet on the certificate. Absent when coverage is complete.

    Item fields
    • hostnamestring
    • statusstring

      pending — being issued; failed — the last attempt failed; missing — not requested yet.

      One of: "pending" "failed" "missing"
    • failure_countinteger

      Failed attempts so far for this name.

    • max_retriesinteger

      Automatic retries a failing name gets.

    • next_retry_atstring (date-time)

      When the next automatic retry runs.

    • last_errorstring

      The certificate authority's own reason for the last failure.

  • trustedboolean

    Whether the served certificate chains to a public root. false means no browser will accept it — a private CA (for example a Cloudflare Origin CA certificate), a self-signed certificate, or an internal PKI. Absent when the bundle has not been evaluated, which is a different state from false and should not be shown as a failure.

  • trust_notestring

    Why the certificate is flagged, phrased for the certificate's owner. Can be present even when trusted is true — an otherwise genuine certificate missing its intermediate is reported here.

  • leaf_onlyboolean

    The bundle carries no intermediate certificate. Clients that do not already hold the issuer fail the handshake with "unable to get local issuer certificate". Independent of trusted. Absent when the bundle has not been evaluated.

  • pinnedboolean

    The certificate on display is one you chose, rather than whatever the domain would serve by default. See GET /domains/{domain}/ssl/certificates.

  • sourcestring

    Where the certificate being served came from.

    One of: "acme" "acme-staging" "uploaded"
  • has_managed_certboolean

    NSIN holds an unexpired certificate of its own for this domain — i.e. there is something to switch back to.

  • managed_requestedboolean

    You have already asked NSIN to issue alongside your upload and the order is on its way.

  • can_request_managedboolean

    Whether POST /domains/{domain}/ssl/certificates/request would be accepted right now.

json
{
  "status": "valid",
  "expires_at": "2026-01-01T00:00:00Z",
  "issued_at": "2026-01-01T00:00:00Z",
  "days_remaining": 0,
  "issuer": "string",
  "subject": "string",
  "serial_number": "string",
  "sans": [
    "string"
  ],
  "signature_algorithm": "string",
  "key_size": 0,
  "is_wildcard": true,
  "auto_renewal": true,
  "has_private_key": true,
  "can_manual_issue": true,
  "manual_issue_reason": "string",
  "next_manual_issue_at": "2026-01-01T00:00:00Z",
  "last_issue_attempt_at": "2026-01-01T00:00:00Z",
  "failure_count": 0,
  "max_retries": 0,
  "next_retry_at": "2026-01-01T00:00:00Z",
  "last_error": "string",
  "hostname": "string",
  "covered_hostnames": [
    "string"
  ],
  "uncovered_hostnames": [
    "string"
  ],
  "coverage": [
    {
      "hostname": "string",
      "status": "pending",
      "failure_count": 0,
      "max_retries": 0,
      "next_retry_at": "2026-01-01T00:00:00Z",
      "last_error": "string"
    }
  ],
  "trusted": true,
  "trust_note": "string",
  "leaf_only": true,
  "pinned": true,
  "source": "acme",
  "has_managed_cert": true,
  "managed_requested": true,
  "can_request_managed": true
}
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/ssl/" \
  -H "Authorization: Bearer $NSIN_API_KEY"
esc