The WebhookSubscription model
WebhookSubscription modelA webhook subscription represents a subscription to one or more events for which users receive notifications.
| Attribute | Type | Description |
|---|---|---|
id | string | Unique identifier for the webhook. |
name | string | A name that identifies this subscription. Perk sends this name in the notification JSON payload. |
url | string | The target URL where Perk sends notification JSON payloads as POST requests. |
secret | string | A secret known only to you and Perk. Perk uses this secret to sign the payload and includes it in the TkSignature header. |
events | string | The event names this subscription is configured to receive. |
enabled | boolean | true if the subscription is enabled. |
successfully_sent | integer | Read-only. Number of successful notifications delivered to this endpoint. |
failed_sent | integer | Read-only. Number of notifications that failed to be delivered to this endpoint. |
error_rate | float | Read-only. Ratio of successfully delivered events to total events sent. Values range from 0.0 to 1.0. |
{
"id": "362c99f1-e67e-4075-bd98-156913e3d113",
"name": "invoice webhook",
"url": "https://mycompany.com/tk_webhook",
"secret": "<your_webhook_secret>",
"enabled": true,
"events": [
"invoice.issued",
"invoiceline.created"
],
"successfully_sent": 2,
"failed_sent": 0,
"error_rate": 0.0
}
