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

Unread counters for tickets and notifications

gethttps://api.nsin.ir/badges

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

Both of the panel's header badges in one request: open support tickets whose latest message is an unread reply from support, and unseen notifications. The numbers are exactly what GET /tickets/unread-count and GET /notifications/unread-count return — poll this one endpoint instead of both.

Responses

200Unread counters.

Content type: application/json

  • tickets_unreadinteger

    Open tickets with an unread reply from support.

  • notifications_unreadinteger

    Notifications in your feed not yet marked seen.

json
{
  "tickets_unread": 1,
  "notifications_unread": 4
}
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"
}
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/badges" \
  -H "Authorization: Bearer $NSIN_API_KEY"
esc