Skip to content

Mark notifications as read

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

Marks as read the notifications listed in ids (or all of them with all: true) and answers how many changed. A notification that was already read keeps its first read time. A body with neither field changes nothing.

Who: a signed-in player, who can only mark their own notifications.

Refusals:

Media type application/json

Which notifications to mark as read.

object
all

true marks every unread notification as read; ids is then ignored. Default false.

boolean
ids

Ids of the notifications to mark as read.

Array<integer>
Example generated
{
"all": true,
"ids": [
1
]
}

Success or a refusal: read success (the refusals are in the description).

Media type application/json
object
code

A machine-readable reason next to error, set only where the caller must act differently. tx_pending: the payment was not refused but could not be verified yet; keep the transaction hash and confirm again with the same hash, never pay twice.

string | null
data

The answer. Present when success is true.

object
updated
required

Notifications that changed from unread to read.

integer format: int64
error

Why the request was refused, in plain words. Present when success is false.

string | null
success
required

true when the request did what it asked. false is a refusal: read error.

boolean
Example
{
"data": {
"updated": 2
},
"success": true
}

No valid session. The body is plain text: Missing Authorization header, Invalid Authorization format, Invalid session token or Session expired or invalid. Sign in again.

Media type text/plain
string
Example
Session expired or invalid