Request examples
The following examples detail the various JSON objects used with the webhooks endpoint.
Webhook edit
Data used to create or update a webhook.
Name |
Type |
Purpose |
---|---|---|
|
String |
A human-readable label describing the purpose of the webhook. |
|
URI |
The URI to make the web request to. |
|
String |
The HTTP method to use when making the web request. Must be |
|
Object |
Custom headers to send when making the web request. Commonly used for authentication. The |
|
String |
The body to post when making the web request. May only be populated if |
|
String |
JSON object to include in the body of the webhook request. May only be populated if |
|
String |
The name of the user who created the webhook. |
|
String |
Determines how the webhook is executed. Must be OnEnd or OnUpdate. |
|
Boolean |
Indicates whether the webhook is disabled or not. If set to |
Example:
{
"label": "webhook 29",
"uri": "https://www.target-domain-of-the-webhook.com/hooks/edge-hook",
"method": "POST",
"headers": {
"x-header": "bar"
},
"body": "{\"rebuild\":\"true\"}",
"createdBy": "anco",
"executionMode": "OnEnd"
"disabled": false
}
Webhook
The information that defines a webhook is structured as follows:
Name |
Type |
Purpose |
---|---|---|
|
String |
The identifier used to identify this webhook. |
|
String |
The ID of the tenant this webhook belongs to. |
|
String |
A human-readable label describing the purpose of the webhook. |
|
URI |
The URI to make the web request to. |
|
String |
The HTTP method to use when making the web request. Must be |
|
Object |
Custom headers to send when making the web request. Commonly used for authentication. The |
|
String |
The body to post when making the web request. May only be populated if |
|
String |
JSON object to include in the body of the webhook request. May only be populated if |
|
String |
The name of the user who created the webhook. |
|
DateTimeOffset |
The timestamp when the webhook was created. |
|
String |
Determines how the webhook is executed. Must be OnEnd or OnUpdate. |
|
Array |
Logs the results of the latest execution of the webhook. |
|
Boolean |
Indicates whether the webhook is disabled or not. If set to |
Example:
{
"id": "5678",
"tenantId": "target-corp",
"label": "webhook 29",
"uri": "https://www.target-domain-of-the-webhook.com/hooks/edge-hook",
"method": "POST",
"headers": {
"x-header": "bar"
},
"body": "{\"rebuild\":\"true\"}",
"createdBy": "anco",
"created": "2021-03-26T10:44:04.6107312+00:00",
"executionMode": "OnEnd"
"lastRuns": [
{
"timestamp": "2024-05-30T12:20:10.7253941+00:00",
"success": true
},
{
"timestamp": "2024-05-30T12:16:10.9437159+00:00",
"success": true
}
]
,
"disabled": false
}
Entity update
The entity update describes the updated entity that caused the webhook execution.
Name |
Type |
Description |
---|---|---|
|
String |
The identifier of the entity. |
|
String |
The entity definition which the entity uses. Only populated for an update operation. |
|
String |
The operation performed on the entity. Must be update or delete. |
Example:
{
"identifier": "M.Setting.CleanerInterval",
"entity_definition": "M.Setting",
"operation": "update"
}
Webhook request
The body of a request made to a webhook endpoint that uses the OnUpdate execution mode.
Name |
Type |
Description |
---|---|---|
|
GUID |
Identifies this invocation of the webhook. Used to correlate across large counts of updates spanning across multiple webhook requests. |
|
Array of |
The updated entities which caused the webhook execution. |
|
Boolean |
Indicates whether there will be an additional request to continue sending more updates. This occurs when there are many updates and split between multiple requests. |
If the webhook definition includes the bodyInclude
field, this is inserted in the resulting JSON object.
Example:
{
"invocation_id": "7734f16b-1e46-4321-a40e-522255d6c17a",
"updates": [
{
"identifier": "M.Setting.CleanerInterval",
"entity_definition": "M.Setting",
"operation": "update"
},
{
"identifier": "Content.PowerFromWithin",
"operation": "delete"
}
],
"continues": false
}
In the following example, the webhook definition includes the following for the bodyInclude
field:
{
"authorization": 132332,
"rebuild": true,
"department": "engineering"
}
All properties of the JSON object are added to the JSON request body:
{
"authorization": 132332,
"rebuild": true,
"department": "engineering",
"invocation_id": "7734f16b-1e46-4321-a40e-522255d6c17a",
"updates": [
{
"identifier": "M.Setting.CleanerInterval",
"operation": "delete"
},
{
"identifier": "Content.PowerFromWithin",
"entity_definition": "M.Content",
"operation": "update"
}
],
"continues": false
}
OnUpdate execution
If there are many updates to send, these are split into batches and sent over multiple requests. All requests for the same invocation (triggers) have the same invocation_id
set. All requests have the continues
field set to true
except the last request for the invocation. Downstream systems can use this field to know whether to expect additional requests for the invocation or not.
Example:
Consider an update of three separate entities. If the maximum batch size is 2
, then the payloads of the requests sent to the webhook endpoint are as follows:
{
"invocation_id": "8834f16b-1e46-4321-a40e-522255d6c17a",
"updates": [
{
"identifier": "M.Setting.CleanerInterval",
"entity_definition": "M.Setting",
"operation": "update"
},
{
"identifier": "Content.PowerFromWithin",
"entity_definition": "M.Content",
"operation": "update"
}
],
"continues": true
}
The continues
field is true
, indicating that another request follows:
{
"invocation_id": "8834f16b-1e46-4321-a40e-522255d6c17a",
"updates": [
{
"identifier": "M.Setting.UpdateInterval",
"entity_definition": "M.Setting",
"operation": "update"
}
],
"continues": false
}