EndpointsNotifications

Notifications

Function-calling namespace: notifications

  • Base URL: https://api.aivida.in
  • Engine endpoint: POST /api
  • Auth: Stack token middleware enabled in optional mode.
  • Send token in header: x-stack-access-token: <access_token> (or Authorization: Bearer <access_token>).
  • In optional mode: no token is allowed; invalid token is rejected with 401.

create

Source: backend/endpoints/notifications/create

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
recipientStackUserIdstringYes-
recipientRolestringYes-
typestringYes-
titlestringYes-
messagestringYes-
prioritystringNo-
modulestringNoalias for relatedEntityType
relatedEntityTypestringNowins over module when both are sent
relatedEntityIdstringNo-
actionUrlstringNo-
navigationTargetstringNo-
navigationParamsobjectNo-
channelsarray<string>No-
deliveryStatestringNo-
pushTicketIdsarray<string>No-
deliveryErrorstringNo-
dedupeKeystringNo-
expiresAtintegerNounix-ms timestamp; nullable
isReadbooleanNo-
readAtintegerNounix-ms timestamp; nullable
openedAtintegerNounix-ms timestamp; nullable
createdAtintegerNounix-ms timestamp; nullable

Module Alias

  • module is a frontend-friendly alias for relatedEntityType.
  • If both module and relatedEntityType are sent, relatedEntityType wins.
  • 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

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-

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

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-

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

FieldTypeRequiredConstraints
organizationIdstringYes-
modulestringNooptional module filter, e.g. appointments
pageintegerNodefault: 1
pageSizeintegerNodefault: 20

Module Filtering

  • module is optional and filters notifications by relatedEntityType / notification type.
  • Use module: "appointments" to read appointment-related notifications.
  • Existing payloads without module continue 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

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-
recipientStackUserIdstringNonullable
recipientRolestringNonullable
typestringNonullable
titlestringNonullable
messagestringNonullable
prioritystringNonullable
modulestringNoalias for relatedEntityType; nullable
relatedEntityTypestringNonullable
relatedEntityIdstringNonullable
actionUrlstringNonullable
navigationTargetstringNonullable
navigationParamsobjectNonullable
channelsarray<string>Nonullable
deliveryStatestringNonullable
pushTicketIdsarray<string>Nonullable
deliveryErrorstringNonullable
dedupeKeystringNonullable
expiresAtintegerNounix-ms timestamp; nullable
isReadbooleanNonullable
readAtintegerNounix-ms timestamp; nullable
openedAtintegerNounix-ms timestamp; nullable
createdAtintegerNounix-ms timestamp; nullable

Module Alias

  • module can be used to update the notification bucket. It maps to relatedEntityType when relatedEntityType is 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": {} }