Notifications
Function-calling namespace: notifications
- Base URL:
https://api.aivida.in - Engine endpoint:
POST /api - Auth: Stack token middleware enabled in
optionalmode. - Send token in header:
x-stack-access-token: <access_token>(orAuthorization: Bearer <access_token>). - In
optionalmode: no token is allowed; invalid token is rejected with401.
create
Source: backend/endpoints/notifications/create
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
recipientStackUserId | string | Yes | - |
recipientRole | string | Yes | - |
type | string | Yes | - |
title | string | Yes | - |
message | string | Yes | - |
priority | string | No | - |
module | string | No | alias for relatedEntityType |
relatedEntityType | string | No | wins over module when both are sent |
relatedEntityId | string | No | - |
actionUrl | string | No | - |
navigationTarget | string | No | - |
navigationParams | object | No | - |
channels | array<string> | No | - |
deliveryState | string | No | - |
pushTicketIds | array<string> | No | - |
deliveryError | string | No | - |
dedupeKey | string | No | - |
expiresAt | integer | No | unix-ms timestamp; nullable |
isRead | boolean | No | - |
readAt | integer | No | unix-ms timestamp; nullable |
openedAt | integer | No | unix-ms timestamp; nullable |
createdAt | integer | No | unix-ms timestamp; nullable |
Module Alias
moduleis a frontend-friendly alias forrelatedEntityType.- If both
moduleandrelatedEntityTypeare sent,relatedEntityTypewins. - Example: send
module: "appointments"for appointment notifications.
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "notifications",
"apiName": "create",
"data": {
"organizationId": "org_123",
"recipientStackUserId": "user_123",
"recipientRole": "patient",
"type": "appointment_reminder",
"title": "Appointment reminder",
"message": "Your appointment starts soon.",
"module": "appointments",
"relatedEntityId": "appointment_123"
}
}'Example Response
{ "status": "ok", "data": {} }delete
Source: backend/endpoints/notifications/delete
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "notifications",
"apiName": "delete",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }getById
Source: backend/endpoints/notifications/get-by-id
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "notifications",
"apiName": "getById",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }listByOrganization
Source: backend/endpoints/notifications/list-by-organization
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
module | string | No | optional module filter, e.g. appointments |
page | integer | No | default: 1 |
pageSize | integer | No | default: 20 |
Module Filtering
moduleis optional and filters notifications byrelatedEntityType/ notification type.- Use
module: "appointments"to read appointment-related notifications. - Existing payloads without
modulecontinue to return all organization notifications.
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "notifications",
"apiName": "listByOrganization",
"data": {
"organizationId": "org_123",
"module": "appointments",
"page": 1,
"pageSize": 20
}
}'Example Response
{ "status": "ok", "data": {} }update
Source: backend/endpoints/notifications/update
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
recipientStackUserId | string | No | nullable |
recipientRole | string | No | nullable |
type | string | No | nullable |
title | string | No | nullable |
message | string | No | nullable |
priority | string | No | nullable |
module | string | No | alias for relatedEntityType; nullable |
relatedEntityType | string | No | nullable |
relatedEntityId | string | No | nullable |
actionUrl | string | No | nullable |
navigationTarget | string | No | nullable |
navigationParams | object | No | nullable |
channels | array<string> | No | nullable |
deliveryState | string | No | nullable |
pushTicketIds | array<string> | No | nullable |
deliveryError | string | No | nullable |
dedupeKey | string | No | nullable |
expiresAt | integer | No | unix-ms timestamp; nullable |
isRead | boolean | No | nullable |
readAt | integer | No | unix-ms timestamp; nullable |
openedAt | integer | No | unix-ms timestamp; nullable |
createdAt | integer | No | unix-ms timestamp; nullable |
Module Alias
modulecan be used to update the notification bucket. It maps torelatedEntityTypewhenrelatedEntityTypeis not provided.
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "notifications",
"apiName": "update",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }