# Create a webhook
curl -X POST https://yourdomain.com/api/v1/webhooks \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"path": "stripe/payment",
"function_namespace": "payments",
"function_name": "process_webhook",
"http_method": "POST",
"requires_auth": false,
"default_values": {"source": "stripe"}
}'
# Trigger it
curl -X POST https://yourdomain.com/webhooks/stripe/payment \
-H "Content-Type: application/json" \
-d '{"event": "charge.succeeded", "amount": 1000}'
# Function receives: {"source": "stripe", "event": "charge.succeeded", "amount": 1000}