Nurama Developers
Namespaces

webhook

Methods and types of the `webhook` namespace (`client.webhook` / `bot.webhook`).

Interfaces

CreateWebhookData

Properties

PropertyTypeDescription
eventsWebhookEvent[]-
expiresAt?string | nullOptional ISO timestamp. Must be in the future when set.
namestring-
urlstring-

CreateWebhookResponse

Extended by

Properties

PropertyTypeDescription
signingSecretstringThe HMAC signing secret. Returned ONLY here (and from rotateWebhookSecret). The server keeps the ciphertext on the row and cannot recover the plaintext later — the customer must capture it now or rotate.
subscriptionWebhookSubscription-

ListDeliveriesParams

Properties

PropertyType
cursor?string
limit?number
status?WebhookAttemptStatus

ListDeliveriesResponse

Properties

PropertyType
itemsWebhookAttempt[]
nextCursorstring | null

RotateWebhookSecretResponse

Extends

Properties

PropertyTypeDescriptionInherited from
signingSecretstringThe HMAC signing secret. Returned ONLY here (and from rotateWebhookSecret). The server keeps the ciphertext on the row and cannot recover the plaintext later — the customer must capture it now or rotate.CreateWebhookResponse.signingSecret
subscriptionWebhookSubscription-CreateWebhookResponse.subscription

TestWebhookResponse

Properties

PropertyType
messagestring
queuedtrue

UpdateWebhookData

Properties

PropertyTypeDescription
events?WebhookEvent[]-
expiresAt?string | nullPass null to clear an existing expiry; pass a future ISO date to set / extend.
name?string-
status?"active" | "paused"-
url?string-

WebhookAttempt

Properties

PropertyType
attemptnumber
createdAtstring
deliveredAt?string | null
errorMessage?string | null
idstring
maxAttemptsnumber
nextRetryAt?string | null
notificationIdstring
responseBody?string | null
responseCode?number | null
responseHeaders?Record<string, any> | null
scheduledAtstring
signatureV1string
startedAt?string | null
statusWebhookAttemptStatus
subscriptionIdstring
updatedAtstring

WebhookSubscription

Public shape of a webhook subscription. Never includes the signing secret or the encrypted ciphertext — those are server-only fields.

Properties

PropertyTypeDescription
appId?string | null-
createdAtstring-
createdByIdstring-
eventsWebhookEvent[]-
expiresAt?string | nullOptional expiration. When set and in the past, the worker stops fanning new attempts to this subscription, and any in-flight attempts DLQ with a clear reason rather than retrying. Null = no expiry; the subscription delivers indefinitely until manually paused or deleted.
failedOutAt?string | null-
failedOutReason?string | null-
idstring-
lastDeliveryAt?string | null-
lastFailureAt?string | null-
lastSuccessAt?string | null-
namestring-
statusWebhookSubscriptionStatus-
updatedAtstring-
urlstring-
workspaceIdstring-

Type Aliases

WebhookAttemptStatus

type WebhookAttemptStatus = "pending" | "inflight" | "succeeded" | "failed" | "dlq";

WebhookEvent

type WebhookEvent = 
  | "task.created"
  | "task.updated"
  | "task.deleted"
  | "chat.message.created"
  | "asset.published"
  | "webhook.test";

Wire-format webhook event names. New events are added over time, and payloads only ever gain fields, so receivers pinned to a specific event name keep working as the contract grows.


WebhookSubscriptionStatus

type WebhookSubscriptionStatus = "active" | "paused" | "failedOut";

Functions

default()

function default(client): {
  createWebhook: Promise<CreateWebhookResponse>;
  deleteWebhook: Promise<void>;
  getWebhook: Promise<WebhookSubscription>;
  listWebhookDeliveries: Promise<ListDeliveriesResponse>;
  listWebhooks: Promise<WebhookSubscription[]>;
  replayWebhookDelivery: Promise<{
     attempt: WebhookAttempt;
  }>;
  rotateWebhookSecret: Promise<RotateWebhookSecretResponse>;
  testWebhook: Promise<TestWebhookResponse>;
  updateWebhook: Promise<WebhookSubscription>;
};

Outbound webhook subscription management. Admin-gated server-side by canManageWebhooks. All operations are workspace-scoped — there is no app-owned surface here yet (Phase 3 / OAuth).

Parameters

ParameterType
clientdefault

Returns

NameTypeDescription
createWebhook()(workspaceId, data) => Promise<CreateWebhookResponse>Create a webhook subscription. The signing secret is in the response's secret field — store it immediately, it cannot be retrieved again. Requires canManageWebhooks on the workspace.
deleteWebhook()(workspaceId, webhookId) => Promise<void>Delete a webhook subscription. In-flight deliveries continue to the receiver until they exhaust retries; no new deliveries fire. Requires canManageWebhooks on the workspace.
getWebhook()(workspaceId, webhookId) => Promise<WebhookSubscription>Fetch a single webhook subscription by id. Requires canManageWebhooks on the workspace.
listWebhookDeliveries()( workspaceId, webhookId, params? ) => Promise<ListDeliveriesResponse>Paginated list of delivery attempts for a webhook subscription. Useful for diagnosing failures (HTTP status, response body snippet, retry timing). Requires canManageWebhooks on the workspace.
listWebhooks()(workspaceId) => Promise<WebhookSubscription[]>List webhook subscriptions in a workspace. Secrets are never returned. Requires canManageWebhooks on the workspace.
replayWebhookDelivery()( workspaceId, webhookId, attemptId ) => Promise<{ attempt: WebhookAttempt; }>Re-fire a specific past delivery attempt. Useful for confirming a receiver fix without waiting for the next real event. Requires canManageWebhooks on the workspace.
rotateWebhookSecret()(workspaceId, webhookId) => Promise<RotateWebhookSecretResponse>Generate a new HMAC signing secret for a subscription and return it once. The old secret is invalidated immediately. Requires canManageWebhooks on the workspace.
testWebhook()(workspaceId, webhookId) => Promise<TestWebhookResponse>Fire a synthetic webhook.test delivery to the subscription's URL. The receiver gets a small payload they can use to verify their HMAC + parsing setup. Returns immediately; check the delivery log for the outcome.
updateWebhook()( workspaceId, webhookId, data ) => Promise<WebhookSubscription>Update a webhook subscription's url, event filter, or active state. Requires canManageWebhooks on the workspace.

On this page