interface GetEmailLogsProps { /** Agent key. */ mailAgentKey?: string; /** Request ID of an email. */ requestId?: string; /** Start date filter. Accepts a `Date` object, ISO string, or timestamp. */ dateFrom?: Date | string | number; /** End date filter. Accepts a `Date` object, ISO string, or timestamp. */ dateTo?: Date | string | number; /** From address. */ from?: string; /** Recipient (To) address. */ to?: string; /** CC address. */ cc?: string; /** BCC address. */ bcc?: string; /** Recipient address (matches to/cc/bcc). */ recipient?: string; /** Number of initial records to skip. */ offset?: number; /** Number of records to fetch. */ limit?: number; /** Subject of the mail. */ subject?: string; /** Client reference ID of the mail. */ clientReference?: string; /** Filter all hard bounced mails. */ isHardBounced?: boolean; /** Filter all soft bounced mails. */ isSoftBounced?: boolean; /** Filter all process failed mails. */ isMailFailure?: boolean; /** Filter all delivered mails. */ isDelivered?: boolean; } /** A single email address entry as returned by the API. */ interface EmailAddress { address: string; name?: string; } /** Static information about an email message. */ interface EmailInfo { email_reference: string; mail_type: string; subject: string; bounce_address?: string; from: EmailAddress; message_id: string; to: EmailAddress[]; cc?: EmailAddress[]; bcc?: EmailAddress[]; processed_time: string; mailagent_key: string; status: string; } /** A single tracking event (open / click). */ interface EmailTrackingEventDetail { time: string; first_event_time: string; user_agent?: string; } /** A grouped tracking event with its individual occurrences and aggregate count. */ interface EmailTrackingEvent { details: EmailTrackingEventDetail[]; event_count: number; } /** * Tracking details for an email. Fields are populated only when the * corresponding event has occurred; the object is `{}` otherwise. */ interface EmailTrackingDetails { email_open?: EmailTrackingEvent; email_link_click?: EmailTrackingEvent; } /** A single delivery / failure event entry per recipient. */ interface EmailDeliveryEvent { recipient: string; time: string; reason?: string; category?: string; } /** * Delivery details for an email, grouped by outcome. * Each bucket is an array of per-recipient events, present only when applicable. */ interface EmailDeliveryDetails { delivered?: EmailDeliveryEvent[]; hardbounce?: EmailDeliveryEvent[]; softbounce?: EmailDeliveryEvent[]; mailfailure?: EmailDeliveryEvent[]; } /** * A single email log entry. Used both as a list-row (with empty * tracking/delivery objects) and as the full detail payload. */ interface EmailLog { email_info: EmailInfo; email_tracking_details: EmailTrackingDetails; email_delivery_details: EmailDeliveryDetails; request_id: string; } /** Pagination metadata returned alongside list responses. */ interface EmailLogsListMetadata { offset: number; count: number; } interface EmailLogsListResponse { metadata: EmailLogsListMetadata; data: { logs: EmailLog[]; }; status: "success"; } interface EmailDetailResponse { data: EmailLog; status: "success"; } export type { ResponseType } from "../BaseModel/types"; export type { GetEmailLogsProps, EmailAddress, EmailInfo, EmailTrackingEventDetail, EmailTrackingEvent, EmailTrackingDetails, EmailDeliveryEvent, EmailDeliveryDetails, EmailLog, EmailLogsListMetadata, EmailLogsListResponse, EmailDetailResponse };