Skip to content

WebhooksCore

Defined in: src/core.ts:296

The admin + publish core surface.

Property Modifier Type Description Defined in
options readonly object - src/core.ts:297
options.allowInsecureUrls public boolean - src/core.ts:306
options.dispatcher? public DispatcherOptions - src/core.ts:304
options.hooks public WebhooksHooks[] Normalized hooks (always an array). src/core.ts:302
options.now public () => number - src/core.ts:312
options.onDelivery? public DeliveryListener - src/core.ts:310
options.onDeliveryError? public DeliveryErrorReporter - src/core.ts:311
options.payloadLimitBytes public number - src/core.ts:308
options.queueStorage public KvStorage - src/core.ts:299
options.readonly public boolean - src/core.ts:300
options.requireKnownEventTypes public boolean - src/core.ts:309
options.retention? public RetentionOptions - src/core.ts:303
options.secretRotationGrace public WebhookDuration - src/core.ts:305
options.storage public KvStorage - src/core.ts:298
options.urlPolicy? public (url) => boolean - src/core.ts:307
claimDueDeliveries(input): Promise<Delivery[]>;

Defined in: src/core.ts:459

Claim up to limit due deliveries for exclusive processing. Uses the storage’s native claimDue when available; otherwise scans the due index with compare-and-swap claiming (plain read-modify-write when the storage has no CAS — single-dispatcher assumption, see docs/DELIVERY.md).

Parameter Type
input ClaimInput

Promise<Delivery[]>


createApplication(input, options?): Promise<Application>;

Defined in: src/core.ts:317

Parameter Type
input { key: string; metadata?: JsonValue; name?: string; }
input.key string
input.metadata? JsonValue
input.name? string
options? ActorOptions

Promise<Application>


createEndpoint(
applicationKey,
input,
options?
): Promise<Endpoint>;

Defined in: src/core.ts:344

Creates the endpoint and generates its first signing secret.

Parameter Type
applicationKey string
input { description?: string; disabled?: boolean; eventTypes?: string[]; headers?: Record<string, string>; metadata?: JsonValue; url: string; }
input.description? string
input.disabled? boolean
input.eventTypes? string[]
input.headers? Record<string, string>
input.metadata? JsonValue
input.url string
options? ActorOptions

Promise<Endpoint>


deleteApplication(applicationKey, options?): Promise<void>;

Defined in: src/core.ts:328

Deletes the application and everything under it (endpoints, messages, deliveries).

Parameter Type
applicationKey string
options? ActorOptions

Promise<void>


deleteEndpoint(
applicationKey,
endpointId,
options?
): Promise<void>;

Defined in: src/core.ts:368

Parameter Type
applicationKey string
endpointId string
options? ActorOptions

Promise<void>


deleteEventType(name, options?): Promise<void>;

Defined in: src/core.ts:338

Delete an event type. Endpoints referencing it keep their subscription entry and simply stop matching new publishes of that name.

Parameter Type
name string
options? ActorOptions

Promise<void>


disableEndpoint(
applicationKey,
endpointId,
options?
): Promise<Endpoint>;

Defined in: src/core.ts:385

Parameter Type
applicationKey string
endpointId string
options? ActorOptions

Promise<Endpoint>


enableEndpoint(
applicationKey,
endpointId,
options?
): Promise<Endpoint>;

Defined in: src/core.ts:380

Parameter Type
applicationKey string
endpointId string
options? ActorOptions

Promise<Endpoint>


getApplication(applicationKey): Promise<
| Application
| null>;

Defined in: src/core.ts:321

Parameter Type
applicationKey string

Promise< | Application | null>


getDelivery(applicationKey, deliveryId): Promise<
| {
attempts: DeliveryAttempt[];
delivery: Delivery;
}
| null>;

Defined in: src/core.ts:406

Parameter Type
applicationKey string
deliveryId string

Promise< | { attempts: DeliveryAttempt[]; delivery: Delivery; } | null>


getEndpoint(applicationKey, endpointId): Promise<Endpoint | null>;

Defined in: src/core.ts:342

Parameter Type
applicationKey string
endpointId string

Promise<Endpoint | null>


getEventType(name): Promise<
| EventType
| null>;

Defined in: src/core.ts:332

Parameter Type
name string

Promise< | EventType | null>


getMessage(applicationKey, messageId): Promise<Message | null>;

Defined in: src/core.ts:404

Parameter Type
applicationKey string
messageId string

Promise<Message | null>


getSecrets(applicationKey, endpointId): Promise<EndpointSecret[]>;

Defined in: src/core.ts:379

The endpoint’s secrets (current first). Gate behind endpoint:read-secret.

Parameter Type
applicationKey string
endpointId string

Promise<EndpointSecret[]>


listApplications(): Promise<Application[]>;

Defined in: src/core.ts:316

Promise<Application[]>


listAudit(applicationKey?): Promise<AuditEntry[]>;

Defined in: src/core.ts:446

Newest-first. With applicationKey: that app’s log; without: global + all apps.

Parameter Type
applicationKey? string

Promise<AuditEntry[]>


listDeliveries(applicationKey, options?): Promise<Delivery[]>;

Defined in: src/core.ts:405

Parameter Type
applicationKey string
options? ListDeliveriesOptions

Promise<Delivery[]>


listEndpoints(applicationKey): Promise<Endpoint[]>;

Defined in: src/core.ts:341

Parameter Type
applicationKey string

Promise<Endpoint[]>


listEventTypes(): Promise<EventType[]>;

Defined in: src/core.ts:331

Promise<EventType[]>


listMessages(applicationKey, options?): Promise<Message[]>;

Defined in: src/core.ts:403

Parameter Type
applicationKey string
options? ListMessagesOptions

Promise<Message[]>


noteEndpointOutcome(
applicationKey,
endpointId,
ok,
policy?
): Promise<Endpoint | null>;

Defined in: src/core.ts:467

Update the endpoint’s failure streak after an attempt (any success clears it) and auto-disable once the streak exceeds failingForDays. Returns the endpoint when it was auto-disabled by this call.

Parameter Type
applicationKey string
endpointId string
ok boolean
policy? | false | { failingForDays?: number; }

Promise<Endpoint | null>


previewDeliveryRequest(applicationKey, deliveryId): Promise<
| SignedRequest
| null>;

Defined in: src/core.ts:418

The exact signed HTTP request this delivery would send right now — method, URL, all headers (including the computed webhook-signature), and body. The inspector view: shows what a receiver gets, without sending. Returns null if the delivery or its endpoint no longer exists. The webhook-timestamp/signature reflect the current time (they change per attempt by design); the id and body are stable.

Parameter Type
applicationKey string
deliveryId string

Promise< | SignedRequest | null>


prune(): Promise<void>;

Defined in: src/core.ts:450

Run retention now (also runs opportunistically after publishes).

Promise<void>


publish(
applicationKey,
input,
options?
): Promise<PublishResult>;

Defined in: src/core.ts:396

Persist a message and fan out one pending delivery per matching enabled endpoint. Never performs HTTP; never throws because an endpoint is down.

Parameter Type
applicationKey string
input PublishInput
options? ActorOptions

Promise<PublishResult>


recordAttempt(input): Promise<Delivery>;

Defined in: src/core.ts:461

Record one attempt’s outcome and advance the delivery’s state machine.

Parameter Type
input RecordAttemptInput

Promise<Delivery>


recoverEndpoint(
applicationKey,
endpointId,
input,
options?
): Promise<RecoverResult>;

Defined in: src/core.ts:426

Re-queue every failed delivery for an endpoint created at/after since.

Parameter Type
applicationKey string
endpointId string
input { since: string; }
input.since string
options? ActorOptions

Promise<RecoverResult>


retryDelivery(
applicationKey,
deliveryId,
options?
): Promise<Delivery>;

Defined in: src/core.ts:420

Re-queue a dead-lettered delivery (failed → pending, due immediately).

Parameter Type
applicationKey string
deliveryId string
options? ActorOptions

Promise<Delivery>


rotateSecret(
applicationKey,
endpointId,
options?
): Promise<Endpoint>;

Defined in: src/core.ts:373

Mint a new current secret; the previous one keeps verifying until secretRotationGrace elapses. Expired grace secrets are pruned lazily.

Parameter Type
applicationKey string
endpointId string
options? ActorOptions

Promise<Endpoint>


sendExample(
applicationKey,
endpointId,
input,
options?
): Promise<SendExampleResult>;

Defined in: src/core.ts:437

Fire a one-off signed test delivery at an endpoint, synchronously, through the same wire path as real deliveries (trigger: "test"). The synthetic message is not retained.

Parameter Type
applicationKey string
endpointId string
input { eventType: string; payload?: JsonValue; }
input.eventType string
input.payload? JsonValue
options? ActorOptions

Promise<SendExampleResult>


updateApplication(
applicationKey,
patch,
options?
): Promise<Application>;

Defined in: src/core.ts:322

Parameter Type
applicationKey string
patch { metadata?: JsonValue; name?: string; }
patch.metadata? JsonValue
patch.name? string
options? ActorOptions

Promise<Application>


updateEndpoint(
applicationKey,
endpointId,
patch,
options?
): Promise<Endpoint>;

Defined in: src/core.ts:356

Parameter Type
applicationKey string
endpointId string
patch { description?: string; eventTypes?: string[]; headers?: Record<string, string>; metadata?: JsonValue; url?: string; }
patch.description? string
patch.eventTypes? string[]
patch.headers? Record<string, string>
patch.metadata? JsonValue
patch.url? string
options? ActorOptions

Promise<Endpoint>


upsertEventType(input, options?): Promise<EventType>;

Defined in: src/core.ts:333

Parameter Type
input EventType
options? ActorOptions

Promise<EventType>