Skip to main content

Create a webhook

from nullspace import Lifecycle

lifecycle = Lifecycle()
webhook = lifecycle.create_webhook(
    "https://example.com/nullspace/lifecycle",
    operations=["create", "destroy"],
    signing_secret="whsec_...",
)
print(webhook.id)
lifecycle.close()

Manage webhooks

webhooks = lifecycle.list_webhooks()
webhook = lifecycle.get_webhook("wh_...")
updated = lifecycle.update_webhook("wh_...", enabled=False)
lifecycle.delete_webhook("wh_...")

Deliveries

deliveries = lifecycle.list_webhook_deliveries("wh_...", limit=20)
detail = lifecycle.get_webhook_delivery("wh_...", "del_...")
print(detail.status, detail.attempts)

Security

Use the signing secret to verify webhook payloads in your service. Rotate the secret by updating the webhook. Nullspace includes delivery metadata in HTTP headers:
HeaderMeaning
x-nullspace-webhook-idWebhook registration ID.
x-nullspace-delivery-idDelivery attempt group ID.
x-nullspace-event-idLifecycle event ID.
x-nullspace-signature-versionSignature version used for verification.
x-nullspace-signatureSignature over the delivered payload.
Delivery statuses are queued, in_progress, succeeded, and dead_letter. Inspect deliveries when a receiver returns errors or times out.