Skip to main content

Notification Message Logs

Every notification send is logged server-side so you can query send history and reprocess failed or specific sends. Use ductape.notifications.getMessages() to fetch notification message logs with time filters and filters by product, env, status, and type.

Fetching notification message logs

getMessages() is secured with your Ductape user auth and returns only logs for your workspace. All query parameters are optional; use time filters to narrow by date range.

const { items, total, page, limit, hasMore } = await ductape.notifications.getMessages({
product_tag: 'my-app',
env: 'prd',
start_date: new Date(Date.now() - 7 * 864e5).toISOString(), // last 7 days
end_date: new Date().toISOString(),
status: 'failed',
page: 1,
limit: 50,
});

items.forEach((log) => {
console.log(log.notification_tag, log.status, log.type, log.created_at);
if (log.status === 'failed' && log.error) console.log('Error:', log.error);
});

Query options

OptionTypeDescription
product_tagstringFilter by product (e.g. ductape:rematch)
product_idstringFilter by product ID
envstringFilter by environment slug (e.g. prd)
notification_tagstringFilter by event (e.g. rematch-notifications:order-placed)
statusstringpending | sent | failed | reprocessing
typestringemail | push | sms | callback | notification
process_idstringFilter by process ID from logs
start_datestring | DateStart of time range (ISO string or Date)
end_datestring | DateEnd of time range (ISO string or Date)
pagenumberPage number (default 1)
limitnumberPage size (default 20)

Response shape

interface INotificationMessageLogResult {
items: INotificationMessageLogEntry[];
total: number;
page: number;
limit: number;
hasMore: boolean;
}

interface INotificationMessageLogEntry {
_id?: string;
workspace_id: string;
product_id: string;
product_tag: string;
env: string;
notification_tag: string;
input: Record<string, unknown>; // full input used for the send (for reprocessing)
status: 'pending' | 'sent' | 'failed' | 'reprocessing';
type: 'email' | 'push' | 'sms' | 'callback' | 'notification';
process_id?: string;
error?: string;
retries?: number;
session?: string;
cache?: string;
created_at?: string;
updated_at?: string;
}

Status and type

  • status: pending (queued), sent (delivered), failed (delivery failed), reprocessing (retry in progress).
  • type: Channel for the send — email, push, sms, callback, or notification (multi-channel). Use these to filter by channel or to reprocess by type.

Time filters

Use start_date and end_date to restrict results to a window. You can pass ISO strings or Date objects; the SDK normalizes them to ISO for the API.

// Last 24 hours
await ductape.notifications.getMessages({
start_date: new Date(Date.now() - 864e5).toISOString(),
end_date: new Date().toISOString(),
});

// Last 7 days (Date objects)
await ductape.notifications.getMessages({
start_date: new Date(Date.now() - 7 * 864e5),
end_date: new Date(),
});

Reprocessing

Each log entry stores the full input and context (product, env, notification tag, etc.) used for that send. You can use this data to reprocess a notification (e.g. retry a failed send) by calling notifications.send() or the appropriate channel .send() with the stored input and same product, env, and notification_tag. The backend also supports updating log status (e.g. to reprocessing) via the integrations API.

See Also