WebhookModel
Less than to read
A Webhook is a subscription to receive notifications automatically to the supplied callback url when changes are made to a supported object.
You will need to create at least one Webhook rule to receive notifications when a specific type of object is inserted, deleted, or updated.
Methods
The following API methods use this data model.
- Retrieve Webhook
- Update Webhook
- Create Webhooks
- Regenerate Client Secret
- Regenerate Client Secret
- Query Webhooks
Read-Only Fields
These fields are assigned by the API server and cannot be changed.
webhookId
uuid, read-only
The unique ID of this record, automatically assigned by Sage Network when this record is added to the Sage Network.
groupKey
uuid, read-only
The GroupKey uniquely identifies a single Sage Network account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created.
For more information, see Accounts and GroupKeys.
statusCode
string, nullable, read-only
The status of the webhook (Active, Inactive, Errored).
statusMessage
string, nullable, read-only, 0-100 characters
When the StatusCode is set to Errored a message is supplied for why it was errored.
clientSecret
string, nullable, read-only, 0-100 characters
An secret set during webhook creation that can be used to verify that the notification is coming from the Sage Network API.
created
date-time, read-only
The date this webhook was created
createdUserId
uuid, read-only
The ID of the user who created this webhook
modified
date-time, read-only
The date this webhook was last modified
modifiedUserId
uuid, read-only
The ID of the user who last modified this webhook
partitionKey
string, nullable, read-only
The partition key used for the webhook callback history
Required Fields
name
string, 0-100 characters
A name for the webhook subscription.
requestContentType
string, 0-10 characters
The format of the content to be returned in the webhook notifications. Current options are ‘Full’ or ‘Id’.
callbackHttpMethod
string, 0-6 characters
The HTTP Method to be used on the callback URL for use in notifications (GET, POST, PATCH, PUT).
callbackUrl
uri, 0-250 characters
The URL where the notification will be sent via the method set in CallbackHttpMethod.
When creating a webhook, the Sage Network API will make a call to this url via the method set in the CallbackHttpMethod property with a query parameter of “code” set to an encoded string. To successfully create the webhook, the call must return a successful status code with the query parameter’s value as the plain text content.
retryCount
The amount of consecutive failed notifications, not including the current attempt, before marking the webhook as errored (i.e. if the value is set to 0, the webhook will be marked errored on the first failure, if the value is set to 1 the webhook will be marked errored on the second failure, and so on). The maximum retry attempts is 5.
Optional Fields
expirationDate
date-time, nullable
The expiration date for the given webhook subscription. Once the expiration date passes, notifications will no longer be sent to the callback url.
webhookRules
WebhookRuleModel[], nullable
A list of Webhook Rules associated with this Webhook.