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

Message counts over time

gethttps://api.nsin.ir/domains/{domain}/email-routing/summary

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

Received / forwarded / dropped / rejected / deferred, as totals and as a bucketed series. received is every message except discarded bounces. Requires domain.view.

Path parameters

  • domainstringrequiredpath

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

Query parameters

  • rangestringquery

    Time window, ending now. 30m buckets by minute, 24h by hour, 7d and 30d by day. custom takes RFC 3339 from and to (at most 31 days apart) and picks the bucket from the span.

    One of: "30m" "24h" "7d" "30d" "custom"
    Default: "24h"
  • fromstring (date-time)query

    Start of a custom range, RFC 3339.

  • tostring (date-time)query

    End of a custom range, RFC 3339.

Responses

200Totals and series.

Content type: application/json

  • rangestring
  • fromstring (date-time)
  • tostring (date-time)
  • bucketstring
    One of: "minute" "hour" "day"
  • totalsEmailCounts
    Fields
    • receivedinteger

      Every message except discarded bounces.

    • forwardedinteger

      Messages delivered to a destination.

    • droppedinteger

      Messages accepted and discarded by a drop rule or catch-all.

    • rejectedinteger

      Messages refused.

    • deferredinteger

      Messages temporarily refused (the sender retries), for example over the daily forward cap.

    • sentinteger

      Recipients that mail sent from this domain (the send endpoint) was delivered to. Present on the status counters only.

  • sentinteger

    Recipients that mail sent from this domain was delivered to

  • seriesarray of object
    Item fields
    • tstring (date-time)
    • receivedinteger

      Every message except discarded bounces.

    • forwardedinteger

      Messages delivered to a destination.

    • droppedinteger

      Messages accepted and discarded by a drop rule or catch-all.

    • rejectedinteger

      Messages refused.

    • deferredinteger

      Messages temporarily refused (the sender retries), for example over the daily forward cap.

    • sentinteger

      Recipients that mail sent from this domain (the send endpoint) was delivered to. Present on the status counters only.

json
{
  "range": "string",
  "from": "2026-01-01T00:00:00Z",
  "to": "2026-01-01T00:00:00Z",
  "bucket": "minute",
  "totals": {
    "received": 0,
    "forwarded": 0,
    "dropped": 0,
    "rejected": 0,
    "deferred": 0,
    "sent": 0
  },
  "sent": 0,
  "series": [
    {
      "t": "2026-01-01T00:00:00Z",
      "received": 0,
      "forwarded": 0,
      "dropped": 0,
      "rejected": 0,
      "deferred": 0,
      "sent": 0
    }
  ]
}
400Bad range or custom bounds.

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"
}
503The activity log store is temporarily unreachable. Retry; no data is lost.

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "activity log temporarily unavailable"
}

Example request

bash
curl -X GET "https://api.nsin.ir/domains/example.com/email-routing/summary" \
  -H "Authorization: Bearer $NSIN_API_KEY"
esc