Notifications
Read the feed
List your notifications, mark one read, or mark everything read.
List notifications
Newest first, paginated:
curl "$API_BASE/v1/notifications/?per_page=25&unread=true" \
-H "Authorization: Bearer $TOKEN"from predictai import PredictAI
client = PredictAI(token="pa_live_…")
data = client.notifications.get_notifications(params={"per_page": 25, "unread": True})
import { PredictAI } from "@predictai/sdk";
const client = new PredictAI({ token: "pa_live_…" });
const data = await client.notifications.getNotifications({ params: { per_page: 25, unread: true } });
{
"data": {
"items": [
{
"notification_id": "ntf_7C0A91B4E2D64F58A31006",
"event_code": "training.completed",
"category": "modeling",
"severity": "success",
"title": "Training complete",
"body": "Daily sales forecaster finished in 4m 12s.",
"link": "/workspaces/8b1f3c2a-…/trainings/5d9e02f7-…",
"metadata": {
"training_id": "5d9e02f7-…",
"model_name": "Daily sales forecaster",
"workspace_id": "8b1f3c2a-…",
"duration_s": 252
},
"created_at": "2026-07-15T09:41:07+00:00",
"read_at": null
}
],
"pagination": { "page": 1, "per_page": 25, "total": 42 },
"unread_count": 3
}
}metadata is the raw context of the event (IDs, names, numbers) so you can
route on it without parsing the human-readable body.
Query parameters
| Parameter | Meaning |
|---|---|
per_page optional | Page size, capped at 100. Defaults to 50. |
page optional | 1-based page number. Defaults to 1. |
unread optional | true returns only items with read_at: null. |
since optional | ISO 8601 datetime; only items created after it. Useful for fetching deltas after a stream reconnect. |
Errors
| Status | Why | Example message |
|---|---|---|
400 | page or per_page isn't an integer | "Invalid pagination args" |
401 | Missing or invalid token | "Unauthorized" |
Mark one read
curl -X POST "$API_BASE/v1/notifications/ntf_7C0A91B4E2D64F58A31006/read" \
-H "Authorization: Bearer $TOKEN"from predictai import PredictAI
client = PredictAI(token="pa_live_…")
data = client.notifications.post_notifications_by_notification_id_read("ntf_7C0A91B4E2D64F58A31006")
import { PredictAI } from "@predictai/sdk";
const client = new PredictAI({ token: "pa_live_…" });
const data = await client.notifications.postNotificationsByNotificationIdRead("ntf_7C0A91B4E2D64F58A31006");
{
"data": {
"notification_id": "ntf_7C0A91B4E2D64F58A31006",
"read_at": "2026-07-15T09:45:31+00:00"
}
}The call is idempotent: re-marking an already-read notification (or an ID
that doesn't exist in your feed) still returns 200.
Mark all read
Stamps every unread item in your feed in one call:
curl -X POST "$API_BASE/v1/notifications/mark-all-read" \
-H "Authorization: Bearer $TOKEN"from predictai import PredictAI
client = PredictAI(token="pa_live_…")
data = client.notifications.post_notifications_mark_all_read()
import { PredictAI } from "@predictai/sdk";
const client = new PredictAI({ token: "pa_live_…" });
const data = await client.notifications.postNotificationsMarkAllRead();
{ "data": { "read_at": "2026-07-15T09:46:02+00:00" } }
