@archastro/sdk
    Preparing search index...
    Index

    Constructors

    Methods

    Constructors

    Methods

    • List notification preferences Returns all explicit notification preferences belonging to the authenticated user. Preferences are returned for every (type, channel) combination the user has explicitly configured; slots that have not been overridden are not included and fall back to the type's defaults. The recipient is derived from the authenticated viewer. You cannot retrieve preferences for any other user through this endpoint. All configured preferences — system-level and app-scoped — are returned together in the data array.

      Returns Promise<NotificationPreferenceList>

      An object with a data array containing all explicit notification preferences for the authenticated user.

    • Delete a notification preference Removes the authenticated user's explicit notification preference for a given (type, channel) combination, reverting that slot to the type's default channel set. The app_id param scopes the deletion to a specific app's preference row. Omit app_id to target the system-level (no-app) slot. Because the two slots are stored independently, omitting app_id will not match a row that has one set, and vice versa. Returns 204 No Content on success. Returns 404 if no preference exists for the given composite key.

      Returns Promise<void>

      Empty response body. A 204 No Content status indicates the preference was deleted successfully.

    • Create or update a notification preference Creates or replaces the authenticated user's notification preference for a given (type, channel) combination. This is an idempotent PUT: if no preference exists for the composite key, a new row is created; if one already exists, its enabled flag is updated to the value you provide. The recipient is derived from the authenticated viewer. You cannot set preferences for another user through this endpoint. Pass app_id to scope the preference to a specific app's notifications — most useful for the app_* notification type family. Omit app_id to configure the system-level (no-app) slot. System-level and app-scoped preferences are stored independently and do not overwrite each other. The in_app channel is not configurable and will be rejected with a validation error if supplied.

      Parameters

      • input: { app_id?: string; channel: string; enabled: boolean; type: string }

        Request body.

        • Optionalapp_id?: string

          App to scope this preference to. Omit to configure the system-level (no-app) slot. App-scoped and system-level preferences are stored separately and do not affect each other.

        • channel: string

          Delivery channel to configure (e.g., "email", "sms"). The in_app channel is not configurable and will be rejected with a validation error.

        • enabled: boolean

          Whether the specified channel should be enabled for this notification type and scope. Set to false to suppress delivery on this channel.

        • type: string

          Notification type to configure. Use a builtin name (e.g., "app_info", "billing_alert") or a "custom:<lookup_key>" identifier matching a NotificationType config registered in your app's bundle. Unknown type identifiers are rejected with a validation error.

      Returns Promise<NotificationPreference>

      The created or updated notification preference reflecting the new enabled state.