Skip to content

Mark notifications as seen

POST
/notifications/read
curl --request POST \
--url https://api.nsin.ir/notifications/read \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "ids": [ 1 ], "all": true }'

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.

Media type application/json

Provide ids or all.

object
ids

Notification ids to mark seen. At most 100.

Array<integer>
all

Mark the whole feed seen. Ignores ids.

boolean
Example generated
{
"ids": [
1
],
"all": true
}

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

Media type application/json
object
updated
integer
unread_count
integer
Example generated
{
"updated": 1,
"unread_count": 1
}

Neither ids nor all was given, or more than 100 ids were sent.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

Missing, malformed, revoked or expired API key — or the owning account is inactive.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example invalidKey
{
"error": "invalid API key"
}

The key is read-only and this endpoint is a write. Read-only keys may only issue GET, HEAD and OPTIONS.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example readOnly
{
"error": "read-only API key"
}

The key exceeded its request budget (300 requests per minute by default).

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example limited
{
"error": "rate limit exceeded"
}