---
title: "Notifications"
description: "REST endpoints for notifications. Bearer-auth required."
section: "API"
group: "REST"
order: 47
---

## GET /api/notifications

List notifications.

**Query parameters**

- `limit` (optional): Page size (1–100, default 100).
- `after` (optional): Keyset cursor — return the page after this row (next page).
- `before` (optional): Keyset cursor — return the page before this row (prev page).
- `ids` (optional): Comma-separated list of IDs. Narrows results to these IDs within the caller's accessible scope (does not bypass access checks).
- `filter` (optional): Nested filter expression (`<Entity>Filter`): AND/OR/NOT + per-field comparison operators + relation traversal. JSON-encoded on the query string.
- `orderBy` (optional): Multi-key sort (`<Entity>OrderBy[]`): array of `{ field: direction }` applied in order. Directions: asc/desc plus the four explicit nulls variants. JSON-encoded on the query string.
- `workspace_id` (optional): Filter notifications to this workspace.
- `read` (optional): Filter by read/unread state.
- `include_deleted` (optional): Soft-deleted notification visibility. `false` (default) — active rows only. `true` — active plus soft-deleted. `only` — soft-deleted only (trash view).
- `user_id` (optional): Shorthand: filter where `userId` equals this value.
- `type` (optional): Shorthand: filter where `type` equals this value.

**Response**

```json
{
  "data": [
    {
      "id": "<...>",
      "userId": "<...>",
      "workspaceId": "<...>",
      "type": "<...>",
      "title": "<...>",
      "body": "<...>",
      "data": "<...>",
      "read": "<...>",
      "readAt": "<...>",
      "createdAt": "<...>"
    }
  ],
  "pageInfo": {
    "total": "number",
    "hasNextPage": "boolean",
    "hasPreviousPage": "boolean",
    "startCursor": "string",
    "endCursor": "string"
  }
}
```

## GET /api/notifications/{id}

Get a notification by ID.

**Path parameters**

- `id` (required): Notification to retrieve.

**Response**

```json
{
  "id": "string",
  "userId": "string",
  "workspaceId": "string",
  "type": "info | warning | error | success",
  "title": "string",
  "body": "string",
  "data": {},
  "read": "boolean",
  "readAt": "string",
  "createdAt": "string"
}
```

## DELETE /api/notifications/{id}

Soft-delete a notification.

**Path parameters**

- `id` (required): Notification to soft-delete.

**Response**

```json
{
  "success": "boolean"
}
```

## DELETE /api/notifications/{id}/purge

Permanently delete a soft-deleted notification.

**Path parameters**

- `id` (required): Soft-deleted notification to permanently delete.

**Response**

```json
{
  "success": "boolean"
}
```

## PUT /api/notifications/{id}/read

Mark notification as read

**Path parameters**

- `id` (required): The notification's prefixed ID (e.g. `ntf_...`).

**Response**

```json
{
  "id": "string",
  "userId": "string",
  "workspaceId": "string",
  "type": "info | warning | error | success",
  "title": "string",
  "body": "string",
  "data": {},
  "read": "boolean",
  "readAt": "string",
  "createdAt": "string"
}
```

## POST /api/notifications/{id}/restore

Restore a notification.

**Path parameters**

- `id` (required): Soft-deleted notification to restore.

**Response**

```json
{
  "id": "string",
  "userId": "string",
  "workspaceId": "string",
  "type": "info | warning | error | success",
  "title": "string",
  "body": "string",
  "data": {},
  "read": "boolean",
  "readAt": "string",
  "createdAt": "string"
}
```

## PUT /api/notifications/read-all

Mark all notifications as read

**Response**

```json
{
  "ok": "boolean"
}
```

## GET /api/notifications/unread-count

Get unread count

Returns the number of unread notifications for the caller.

**Response**

```json
{
  "count": "number"
}
```
