Notifications
List the current user's inbox notifications, newest first.
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
limitinteger · min: 1 · max: 200OptionalDefault:
50Responses
200
Successful Response
application/json
fidstringRequiredExample:
notif_abc123456kindstring · enumRequiredPossible values:
The event a notification reports.
Kinds are stored as text, so new kinds need no migration.
categorystring · enumRequiredPossible values:
The domain a notification belongs to, used to group and filter it.
titlestringRequired
bodystringRequired
linkstring · nullableRequired
created_atstring · datetimeRequiredExample:
2024-01-01T00:00:00Zread_atstring · datetime · nullableRequiredExample:
2024-01-01T00:00:00Z422
Validation Error
application/json
get/v2/notifications
GET /v2/notifications HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
[
{
"fid": "notif_abc123456",
"kind": "bid_placed",
"category": "spot",
"title": "text",
"body": "text",
"link": "text",
"created_at": "2024-01-01T00:00:00Z",
"read_at": "2024-01-01T00:00:00Z"
}
]Count the current user's unread inbox notifications.
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
200
Successful Response
application/json
unreadintegerRequired
get/v2/notifications/unread-count
GET /v2/notifications/unread-count HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200
Successful Response
{
"unread": 1
}Mark some of the current user's notifications read.
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
fidsstring[] · min: 1 · max: 500Required
Responses
200
Successful Response
application/json
updatedintegerRequired
422
Validation Error
application/json
post/v2/notifications/read
POST /v2/notifications/read HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 28
{
"fids": [
"notif_abc123456"
]
}{
"updated": 1
}Mark all of the current user's notifications read.
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
200
Successful Response
application/json
updatedintegerRequired
post/v2/notifications/read-all
POST /v2/notifications/read-all HTTP/1.1
Host: api.mithril.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200
Successful Response
{
"updated": 1
}Last updated