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

Activity log

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

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

One row per message, newest first: envelope addresses, the authentication verdicts (SPF, DKIM, DMARC, ARC), what happened to it and why. subject is present only while subject logging is on for the platform. Kept 30 days. 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.

  • statusstringquery

    Narrow to one status.

    One of: "forwarded" "dropped" "rejected" "deferred" "bounce_dropped"
  • qstringquery

    Case-insensitive match against sender, recipient, subject and Message-ID.

  • pageintegerquery
    Default: 1
  • per_pageintegerquery
    Default: 50

Responses

200A page of events.

Content type: application/json

  • eventsarray of EmailEvent
    Item fields
    • event_timestring (date-time)

      When it happened (UTC).

    • nodestring

      The mail host.

    • session_idstring

      SMTP session id on the mail host; one session can carry several transactions.

    • txn_idstring

      The transaction within the session.

    • domain_idinteger
    • domainstring
    • rule_idinteger

      The rule that matched, 0 for none / catch-all.

    • message_idstring

      The message's Message-ID header.

    • from_addrstring

      Envelope sender (MAIL FROM).

    • from_domainstring

      Domain part of the envelope sender.

    • to_addrstring

      Envelope recipient on your domain.

    • destinationstring

      Where it was forwarded.

    • subjectstring

      Truncated to 128; absent while subject logging is off.

    • statusstring
      One of: "forwarded" "dropped" "rejected" "deferred" "bounce_dropped"
    • actionstring
      One of: "forward" "drop" "catch_all" "srs_bounce" "none"
    • reject_stagestring

      connect | rbl | helo | mailfrom | rcpt | data | auth | loop | upstream | quota, or empty.

    • spfstring

      SPF verdict for the incoming message.

    • dkimstring

      DKIM verdict for the incoming message.

    • dmarcstring

      DMARC verdict for the incoming message.

    • dmarc_policystring

      The sender domain's published DMARC policy.

    • arcstring

      ARC verdict for the incoming message.

    • error_codestring

      The SMTP code returned to the sender.

    • error_detailstring

      The receiving server's text, when it refused.

    • client_ipstring

      Address of the server that sent the message to NSIN.

    • client_helostring

      The name that server gave in HELO/EHLO.

    • client_ptrstring

      Reverse DNS name of client_ip.

    • rbl_zonestring

      The DNS blocklist that listed the sender, when one caused the rejection.

    • sizeinteger

      Message size in bytes.

    • spam_scorenumber

      Spam filter score.

    • is_spaminteger

      1 when the spam filter flagged the message.

      One of: 0 1
    • tls_instring

      TLS used by the sending server; empty for plain SMTP.

    • tls_outstring

      TLS used when forwarding; empty when none.

    • tls_out_verifiedinteger

      1 when the forwarding connection verified the receiving server's certificate.

      One of: 0 1
    • upstream_mxstring

      The destination's mail server the message was handed to.

    • upstream_ipstring

      That server's address.

    • egress_ipstring

      The NSIN address the message left from.

    • duration_msinteger

      Transaction time in milliseconds.

    • upstream_msinteger

      Time spent with the destination's server, in milliseconds.

    • attemptsinteger

      Delivery attempts made to the destination.

  • pageinteger
  • per_pageinteger
  • totalinteger
json
{
  "events": [
    {
      "event_time": "2026-01-01T00:00:00Z",
      "node": "string",
      "session_id": "string",
      "txn_id": "string",
      "domain_id": 0,
      "domain": "string",
      "rule_id": 0,
      "message_id": "string",
      "from_addr": "string",
      "from_domain": "string",
      "to_addr": "string",
      "destination": "string",
      "subject": "string",
      "status": "forwarded",
      "action": "forward",
      "reject_stage": "string",
      "spf": "string",
      "dkim": "string",
      "dmarc": "string",
      "dmarc_policy": "string",
      "arc": "string",
      "error_code": "string",
      "error_detail": "string",
      "client_ip": "string",
      "client_helo": "string",
      "client_ptr": "string",
      "rbl_zone": "string",
      "size": 0,
      "spam_score": 0,
      "is_spam": 0,
      "tls_in": "string",
      "tls_out": "string",
      "tls_out_verified": 0,
      "upstream_mx": "string",
      "upstream_ip": "string",
      "egress_ip": "string",
      "duration_ms": 0,
      "upstream_ms": 0,
      "attempts": 0
    }
  ],
  "page": 0,
  "per_page": 0,
  "total": 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/activity" \
  -H "Authorization: Bearer $NSIN_API_KEY"
esc