The WebhookSubscription model

The WebhookSubscription model

A webhook subscription represents a subscription to one or more events for which users receive notifications.

AttributeTypeDescription
idstringUnique identifier for the webhook.
namestringA name that identifies this subscription. Perk sends this name in the notification JSON payload.
urlstringThe target URL where Perk sends notification JSON payloads as POST requests.
secretstringA secret known only to you and Perk. Perk uses this secret to sign the payload and includes it in the TkSignature header.
eventsstringThe event names this subscription is configured to receive.
enabledbooleantrue if the subscription is enabled.
successfully_sentintegerRead-only. Number of successful notifications delivered to this endpoint.
failed_sentintegerRead-only. Number of notifications that failed to be delivered to this endpoint.
error_ratefloatRead-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
}