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

Mark notifications as seen

posthttps://api.nsin.ir/notifications/read

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

Stamps the given notifications as seen, which is what removes them from the unread count. Send ids for specific notifications, or all: true for the whole feed. Notifications already seen keep their original timestamp, so replaying a request is harmless.

Request body

Content type: application/json · required

  • idsarray of integer

    Notification ids to mark seen. At most 100.

  • allboolean

    Mark the whole feed seen. Ignores ids.

Responses

200The number of notifications updated, and the unread count that remains.

Content type: application/json

  • updatedinteger
  • unread_countinteger
json
{
  "updated": 0,
  "unread_count": 0
}
400Neither ids nor all was given, or more than 100 ids were sent.

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"
}
403The key is read-only and this endpoint is a write. Read-only keys may only issue GET, HEAD and OPTIONS.

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 POST "https://api.nsin.ir/notifications/read" \
  -H "Authorization: Bearer $NSIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "ids": [
    0
  ],
  "all": true
}'
esc