Notifications
List undismissed notifications (paged)
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| page | query | integer | |
| limit | query | integer |
Example request
curl "https://YOUR-HOST/api/v1/notifications" \
-H "Authorization: Bearer $TOKEN"
import requests
response = requests.get(
"https://YOUR-HOST/api/v1/notifications",
headers={"Authorization": f"Bearer {TOKEN}"},
)
print(response.json())
const response = await fetch("https://YOUR-HOST/api/v1/notifications", {
method: "GET",
headers: { "Authorization": `Bearer ${TOKEN}` },
});
const data = await response.json();
$ch = curl_init("https://YOUR-HOST/api/v1/notifications");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => ["Authorization: Bearer $token"],
]);
$data = json_decode(curl_exec($ch), true);
Responses
200Paged notification list
| Field | Type | Description |
|---|---|---|
| data | array of object | |
| data[].id | integer | |
| data[].type | string | |
| data[].message | string | |
| data[].action | string | |
| data[].timestamp | string | |
| total | integer |
Example response
json
{
"data": [
{
"id": 1,
"type": "string",
"message": "string",
"action": "string",
"timestamp": "string"
}
],
"total": 1
}
Mark a single notification read/dismissed
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| idrequired | path | integer |
Example request
curl -X POST "https://YOUR-HOST/api/v1/notifications/1/read" \
-H "Authorization: Bearer $TOKEN"
import requests
response = requests.post(
"https://YOUR-HOST/api/v1/notifications/1/read",
headers={"Authorization": f"Bearer {TOKEN}"},
)
print(response.json())
const response = await fetch("https://YOUR-HOST/api/v1/notifications/1/read", {
method: "POST",
headers: { "Authorization": `Bearer ${TOKEN}` },
});
const data = await response.json();
$ch = curl_init("https://YOUR-HOST/api/v1/notifications/1/read");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Authorization: Bearer $token"],
]);
$data = json_decode(curl_exec($ch), true);
Responses
200Success
| Field | Type | Description |
|---|---|---|
| ok | boolean |
Example response
json
{
"ok": true
}
Mark all notifications read/dismissed
Example request
curl -X POST "https://YOUR-HOST/api/v1/notifications/read-all" \
-H "Authorization: Bearer $TOKEN"
import requests
response = requests.post(
"https://YOUR-HOST/api/v1/notifications/read-all",
headers={"Authorization": f"Bearer {TOKEN}"},
)
print(response.json())
const response = await fetch("https://YOUR-HOST/api/v1/notifications/read-all", {
method: "POST",
headers: { "Authorization": `Bearer ${TOKEN}` },
});
const data = await response.json();
$ch = curl_init("https://YOUR-HOST/api/v1/notifications/read-all");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Authorization: Bearer $token"],
]);
$data = json_decode(curl_exec($ch), true);
Responses
200Success
| Field | Type | Description |
|---|---|---|
| ok | boolean |
Example response
json
{
"ok": true
}
Server-Sent Events stream of new notifications
Example request
curl "https://YOUR-HOST/api/v1/notifications/stream" \
-H "Authorization: Bearer $TOKEN"
import requests
response = requests.get(
"https://YOUR-HOST/api/v1/notifications/stream",
headers={"Authorization": f"Bearer {TOKEN}"},
)
print(response.json())
const response = await fetch("https://YOUR-HOST/api/v1/notifications/stream", {
method: "GET",
headers: { "Authorization": `Bearer ${TOKEN}` },
});
const data = await response.json();
$ch = curl_init("https://YOUR-HOST/api/v1/notifications/stream");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => ["Authorization: Bearer $token"],
]);
$data = json_decode(curl_exec($ch), true);
Responses
200SSE stream
Example response
json
"string"