import { APIResource } from "../../core/resource.js"; import * as DevicesAPI from "./devices.js"; import { DeviceCreateParams, DeviceCreateResponse, DeviceDeleteParams, Devices } from "./devices.js"; import { APIPromise } from "../../core/api-promise.js"; import { RequestOptions } from "../../internal/request-options.js"; export declare class Notifications extends APIResource { devices: DevicesAPI.Devices; /** * Bulk update the read status of multiple notifications for the authenticated * user. Set is_read to true to mark as read, or false to mark as unread. Accepts * form data with notification_id (can be sent multiple times) and is_read. */ update(params: NotificationUpdateParams, options?: RequestOptions): APIPromise; /** * Retrieve a list of in-app notifications for the authenticated user with * pagination support. Only notifications with 'in-app' in their delivery channels * from the last 7 days are returned. Notifications include task scheduler events * and other system notifications. */ list(params?: NotificationListParams | null | undefined, options?: RequestOptions): APIPromise; /** * Mark all notifications from the last 7 days for the authenticated user as read * or unread. Set is_read to true to mark all as read, or false to mark all as * unread. Accepts form data with is_read field. */ markAll(params: NotificationMarkAllParams, options?: RequestOptions): APIPromise; /** * List every registered notification event with its available channels, default * channels, and whether a recipient can mute it. The catalog is registry-wide: it * does not reflect per-organization dispatcher rollout, so a listed event may not * yet be delivered for every organization. Contains event and channel metadata * only, never organization or user data. */ retrieveCatalog(params?: NotificationRetrieveCatalogParams | null | undefined, options?: RequestOptions): APIPromise; } /** * Response model for bulk update notifications endpoint. * * Attributes: updated_count (int): Number of notifications successfully updated. * failed_ids (list[str]): List of notification IDs that failed to update. */ export interface NotificationUpdateResponse { /** * Number of notifications successfully updated */ updated_count: number; /** * List of notification IDs that failed to update */ failed_ids?: Array; } /** * Response model for list notifications endpoint. * * Attributes: notifications (list[NotificationItem]): List of notifications. * cursor (str | None): Cursor for pagination (timestamp-based). * notifications_count (int): Total count of notifications for the user. * unread_count (int): Notifications in the user's bell they have not read -- the * badge number. Same organization and window as the list, and independent of the * cursor, so it is the same on every page. */ export interface NotificationListResponse { /** * List of notifications */ notifications: Array; /** * Total count of notifications for the user */ notifications_count: number; /** * Unread in-app notifications from the last 7 days in this organization, for the * badge. The same on every page, regardless of the cursor. */ unread_count: number; /** * Cursor for pagination (timestamp-based) */ cursor?: string | null; } export declare namespace NotificationListResponse { /** * Model representing a single notification. * * Attributes: id (str): Unique identifier for the notification. title (str): Title * of the notification. subtitle (str | None): Subtitle or description of the * notification. source_module (str): Module that generated the notification. * event_type (str): Type of event that triggered the notification. event_status * (str): Status of the event (success/failed). conversation_id (str | None): * Associated conversation ID if applicable. message_id (str | None): Associated * message ID if applicable. chatbot_id (str | None): Associated chatbot ID if * applicable. metadata (dict[str, Any] | None): Additional metadata as JSON. * created_by (str | None): User who created/triggered the notification. created_at * (datetime): When the notification was created. read_at (datetime | None): When * the notification was read by the recipient. updated_at (datetime): When the * notification recipient record was last updated. */ interface Notification { /** * Unique identifier for the notification */ id: string; /** * When the notification was created */ created_at: string; /** * Status of the event (success/failed) */ event_status: string; /** * Type of event that triggered the notification */ event_type: string; /** * Module that generated the notification */ source_module: string; /** * Title of the notification */ title: string; /** * When the notification recipient record was last updated */ updated_at: string; /** * Associated chatbot ID if applicable */ chatbot_id?: string | null; /** * Associated conversation ID if applicable */ conversation_id?: string | null; /** * User ID who created the notification */ created_by?: string | null; /** * Associated message ID if applicable */ message_id?: string | null; /** * Additional metadata as JSON */ metadata?: { [key: string]: unknown; } | null; /** * When the notification was read by the recipient */ read_at?: string | null; /** * Subtitle or description of the notification */ subtitle?: string | null; } } /** * Response model for mark-all notifications endpoint. * * Attributes: updated_count (int): Number of notifications successfully updated. */ export interface NotificationMarkAllResponse { /** * Number of notifications successfully updated */ updated_count: number; } /** * Response model for the notification catalog endpoint. * * Attributes: events (list[NotificationCatalogEvent]): Every registered event, * ordered by event type. */ export interface NotificationRetrieveCatalogResponse { /** * Every registered event */ events: Array; } export declare namespace NotificationRetrieveCatalogResponse { /** * One notification event type a client can receive. * * Attributes: event_type (str): Stable identifier clients route pushes and pick * icons by. source_module (str): Module that owns the event. available_channels * (list[str]): Every channel the event may use. default_channels (list[str]): * Channels used when nobody picks. user_overridable (bool): Whether a recipient * may mute this event. */ interface Event { /** * Every channel the event may use */ available_channels: Array; /** * Channels used when nobody picks */ default_channels: Array; /** * Stable identifier of the event type */ event_type: string; /** * Module that owns the event */ source_module: string; /** * Whether a recipient may mute this event */ user_overridable: boolean; } } export interface NotificationUpdateParams { /** * Body param: Whether to mark as read (true) or unread (false) */ is_read: boolean; /** * Body param: List of notification IDs to update */ notification_id: Array; /** * Header param */ 'Accept-Language'?: string; /** * Header param: Set to `structured` to receive errors in the structured envelope. * Omit it to keep the legacy error body. */ 'X-Error-Format'?: string; } export interface NotificationListParams { /** * Query param: Pointer to keep track of the last fetched notifications */ cursor?: string | null; /** * Query param: Number of notifications to return per request (default 20, max 100) */ limit?: number; /** * Header param */ 'Accept-Language'?: string; /** * Header param */ 'If-None-Match'?: string; /** * Header param: Set to `structured` to receive errors in the structured envelope. * Omit it to keep the legacy error body. */ 'X-Error-Format'?: string; } export interface NotificationMarkAllParams { /** * Body param: Whether to mark as read (true) or unread (false) */ is_read: boolean; /** * Header param */ 'Accept-Language'?: string; /** * Header param: Set to `structured` to receive errors in the structured envelope. * Omit it to keep the legacy error body. */ 'X-Error-Format'?: string; } export interface NotificationRetrieveCatalogParams { 'Accept-Language'?: string; 'If-None-Match'?: string; /** * Set to `structured` to receive errors in the structured envelope. Omit it to * keep the legacy error body. */ 'X-Error-Format'?: string; } export declare namespace Notifications { export { type NotificationUpdateResponse as NotificationUpdateResponse, type NotificationListResponse as NotificationListResponse, type NotificationMarkAllResponse as NotificationMarkAllResponse, type NotificationRetrieveCatalogResponse as NotificationRetrieveCatalogResponse, type NotificationUpdateParams as NotificationUpdateParams, type NotificationListParams as NotificationListParams, type NotificationMarkAllParams as NotificationMarkAllParams, type NotificationRetrieveCatalogParams as NotificationRetrieveCatalogParams, }; export { Devices as Devices, type DeviceCreateResponse as DeviceCreateResponse, type DeviceCreateParams as DeviceCreateParams, type DeviceDeleteParams as DeviceDeleteParams, }; } //# sourceMappingURL=notifications.d.ts.map