Appearance
Create Webhook
Create a webhook subscriber for a product. Requires a paid plan (free-tier products get 402).
POST /v1/products/:id/webhooksRequest Body
json
{
"name": "Slack notifier",
"url": "https://hooks.example.com/packedge",
"events": ["license.created", "payment.completed"],
"secret": "whsec_your_own_signing_secret",
"enabled": true
}| Field | Required | Type | Description |
|---|---|---|---|
name | Yes | string | Display name |
url | Yes | string | HTTPS endpoint that receives the POSTed events |
events | No | string[] | Event types to subscribe to (see Events). Omit to subscribe to all events; a given list must be non-empty. Only these events are delivered |
secret | No | string | Signing secret, 16–128 characters, no whitespace. Omit to have one generated |
enabled | No | boolean | Default: true |
Response
json
{
"data": {
"id": "whk_xxx",
"secret": "whsec_xxx"
}
}Store the secret now
The signing secret (yours, or the generated one) is returned here. Use it to verify deliveries (see Security).
Example
bash
curl -X POST "https://api.packedge.dev/v1/products/prd_xxx/webhooks" \
-H "Authorization: Bearer pk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Slack notifier",
"url": "https://hooks.example.com/packedge",
"events": ["license.created"]
}'