getWebhookTimeseries()
Returns a timeseries result object with
data points and the resolved interval for one webhook app.Usage
The following example shows a basic usage of the backend client from @wacht/nextjs/server.
import { wachtClient } from '@wacht/nextjs/server';export async function getWebhookTimeseries(appSlug: string) { const client = await wachtClient(); return client.webhooks.getWebhookTimeseries(appSlug, { interval: 'hour', start_date: '2026-04-10T00:00:00Z', end_date: '2026-04-17T23:59:59Z', });}Signature
function getWebhookTimeseries( appSlug: string, options?: { interval?: 'minute' | 'hour' | 'day' | 'week' | 'month'; endpoint_id?: number; start_date?: string; end_date?: string; },): Promise<WebhookTimeseriesResult>Parameters
›appSlug?: string | undefined;
appSlug?: string | undefined;Webhook app slug to scope timeseries.
›interval?: 'minute' | 'hour' | 'day' | 'week' | 'month' | undefined;
interval?: 'minute' | 'hour' | 'day' | 'week' | 'month' | undefined;Optional timeseries interval. Backend defaults to day when omitted.
›endpoint_id?: number | undefined;
endpoint_id?: number | undefined;Optional endpoint id filter.
›start_date?: string | undefined;
start_date?: string | undefined;Optional timeseries start timestamp (ISO-8601 string).
›end_date?: string | undefined;
end_date?: string | undefined;Optional timeseries end timestamp (ISO-8601 string).
Return value
›data?: WebhookTimeseriesData[] | undefined;
data?: WebhookTimeseriesData[] | undefined;Timeseries metric points for the selected range.
›timestamp?: string | undefined;
timestamp?: string | undefined;Bucket timestamp.
›total_events?: number | undefined;
total_events?: number | undefined;Total events in the bucket.
›total_deliveries?: number | undefined;
total_deliveries?: number | undefined;Total deliveries in the bucket.
›successful_deliveries?: number | undefined;
successful_deliveries?: number | undefined;Successful deliveries in the bucket.
›failed_deliveries?: number | undefined;
failed_deliveries?: number | undefined;Failed deliveries in the bucket.
›filtered_deliveries?: number | undefined;
filtered_deliveries?: number | undefined;Filtered deliveries in the bucket.
›avg_response_time_ms?: number | null | undefined;
avg_response_time_ms?: number | null | undefined;Average response time for the bucket.
›success_rate?: number | undefined;
success_rate?: number | undefined;Success rate percentage for the bucket.
›interval?: string | undefined;
interval?: string | undefined;Resolved interval returned by backend.
Behavior
- Fetches a single resource by identifier or query context.
- Use this result as the source of truth before update, replay, or delete flows.
Examples
Load default timeseries
import { wachtClient } from '@wacht/nextjs/server';export async function loadTimeseries(appSlug: string) { const client = await wachtClient(); return client.webhooks.getWebhookTimeseries(appSlug);}Load hourly timeseries for one endpoint
import { wachtClient } from '@wacht/nextjs/server';export async function loadEndpointTimeseries(appSlug: string, endpointId: number) { const client = await wachtClient(); return client.webhooks.getWebhookTimeseries(appSlug, { interval: 'hour', endpoint_id: endpointId, });}