> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ns.rocks/llms.txt
> Use this file to discover all available pages before exploring further.

# Lifecycle Webhook

> Register lifecycle webhooks and inspect delivery attempts.

## Setup

```bash theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
uv pip install "nullspace-sdk[cli]==1.0.0"
export NULLSPACE_API_KEY=ns_live_...
export NULLSPACE_API_URL=https://api.your-nullspace-domain
```

## Python

```python theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
from nullspace import Lifecycle

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

for delivery in lifecycle.list_webhook_deliveries(webhook.id, limit=10):
    print(delivery.id, delivery.status)

lifecycle.delete_webhook(webhook.id)
lifecycle.close()
```

## CLI

```bash theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
nullspace lifecycle webhooks create \
  --url https://example.com/nullspace/lifecycle \
  --operation create \
  --operation destroy \
  --signing-secret whsec_replace_me
nullspace lifecycle webhooks deliveries wh_123
```

Guide: [Lifecycle webhooks](../observability/webhooks).
