Table of Contents

Interface IWebhooks

Namespace
BpNexT.Actions.Abstractions
Assembly
BpNexT.Actions.Abstractions.dll

Sends webhooks the runtime delivers for the module: every send is queued durably, posted as JSON, retried with backoff for up to a day if the receiver is down, and recorded in the module's delivery log in Studio. Receivers see a stable Idempotency-Key header across retries, so sending twice is safe on their side.

public interface IWebhooks

Methods

EmitAsync(IWebhookEvent, CancellationToken)

Emits one occurrence of an event: the payload is wrapped in the delivery envelope (id, module, event, timestamp, data), signed, and queued to every webhook an administrator subscribed to the event. Returns how many deliveries were queued — zero simply means nobody subscribed yet. The event name comes from the payload type's WebhookEventAttribute, so it cannot be misspelled.

EmitAsync(string, object, CancellationToken)

String-named variant of EmitAsync(IWebhookEvent, CancellationToken) for events declared with WebhookEventAttribute on the module class.

SendAsync(string, object, WebhookSendOptions?, CancellationToken)

Queues one POST of payload (serialized as JSON) to a URL the module supplies, e.g. from its configuration. Returns once the delivery is queued — the actual send happens in the background.