Webhook
The webhook commands register and manage webhook endpoints, browse the event catalogue, and verify webhook signatures locally. All commands are root-scoped — they do not require --account.
Changed in 0.15.0:
webhook state-diff <account_id>is removed — no v2 endpoint returns account-level state deltas. There is no replacement; reconcile missed events from the webhook deliveries themselves.
webhook create
# Register a new webhook endpoint (write, --preview accepted)
# --source, --request-url, and --account-ids are required
curviate webhook create \
--source <messaging|user|account_status> \
--request-url <https://yourapp.com/webhooks/curviate> \
--account-ids <acc_id1,acc_id2> \
[--name <name>] \
[--format <json|form>] \
[--no-enabled] \
[--events <event1,event2>] \
[--data <key1,key2>]--account-ids is comma-separated. --events and --data are also comma-separated. The webhook is created enabled by default — pass --no-enabled to create it disabled.
webhook list
# List all registered webhooks (paginated)
curviate webhook list [--limit <n>] [--cursor <token>] [--all] [--max-pages <n>]webhook events
List the canonical event type catalogue. Not paginated — --all is not accepted.
# Get all supported event types (read, not paginated)
curviate webhook eventswebhook get
Get a single webhook by id. The plaintext secret is never returned on a read — only secret_prefix.
# Get a single webhook (read)
curviate webhook get <webhook_id>webhook update
Update a registered webhook. --source is immutable — passing it causes the command to exit with code 2 without making an API call.
# Update a webhook (write, --preview accepted)
# --source cannot be changed; passing it is a usage error (exit 2)
curviate webhook update <webhook_id> \
[--request-url <url>] \
[--name <name>] \
[--enabled <true|false>] \
[--format <json|form>] \
[--events <event1,event2>] \
[--data <key1,key2>] \
[--account-ids <acc_id1,acc_id2>]webhook delete
# Delete a webhook (write, --preview accepted)
curviate webhook delete <webhook_id>webhook verify
Offline command — no network call, no API key required. Verifies a webhook payload's HMAC-SHA256 signature locally by calling constructEvent from the SDK directly. Use this to validate your signature-verification logic without running a live server.
# Verify a webhook signature offline (no Curviate client constructed)
curviate webhook verify \
--secret <signing_secret> \
--header <x-curviate-signature-header-value> \
[--body <path-to-body-file|-stdin>] \
[--max-age-secs <n>]On success, the parsed event JSON is written to stdout (exit 0). On a signature mismatch, a structured error is written to stdout and a summary to stderr (exit 2).
Examples
Create a messaging webhook
curviate webhook create \
--source messaging \
--request-url https://yourapp.com/webhooks/messages \
--account-ids acc_YOUR_ACCOUNT_ID \
--name "Message events"Create a webhook disabled
curviate webhook create \
--source user \
--request-url https://yourapp.com/webhooks/users \
--account-ids acc_YOUR_ACCOUNT_ID \
--no-enabledPreview a webhook update
curviate webhook update wh_YOUR_WEBHOOK_ID \
--request-url https://yourapp.com/webhooks/v2/messages \
--previewDisable a webhook
curviate webhook update wh_YOUR_WEBHOOK_ID --enabled falseVerify a webhook payload from a file
# Raw body saved from the incoming HTTP request
curviate webhook verify \
--secret whsec_YOUR_SIGNING_SECRET \
--header "t=1234567890,v1=abc123..." \
--body ./webhook-payload.jsonVerify a webhook payload from stdin
# Pipe the raw request body directly
cat raw-body.txt | curviate webhook verify \
--secret whsec_YOUR_SIGNING_SECRET \
--header "t=1234567890,v1=abc123..." \
--body -Get a single webhook
curviate webhook get wh_YOUR_WEBHOOK_ID