Webhook event handler HTTP request

This topic provides an overview of the properties in a webhook event handler request and displays a sample request.

Webhook event handler common properties

A webhook event handler request payload contains the following properties that identify the webhook item and the event that occurred:

Property

Value type

Description

EventName

string

The event name in XM Cloud.

WebhookItemId

GUID

The ID of the webhook item that subscribed to the event and was triggered.

WebhookItemName

string

The webhook item name.

Event-specific properties

Each event contains event-specific properties. The following table describes the event-specific properties, with events that share identical properties grouped in the same row:

EventName

Property

Value type

Description

item:added

item:versionAdded

item:cloneAdded

item:locked

item:unlocked

item:versionRemoved

item:deleting

Item

Item

The affected item.

item:deleted

Item

Item

The affected item.

ParentID

Guid

The parent ID of the removed item.

item:saved

Item

Item

The saved item.

Changes

ItemChanges

Information about the changes made to the item.

item:copied

Source

Item

The original item.

Copy

Item

The copy of the original item.

item:moved

Item

Item

The moved item.

OldParentID

Guid

The previous parent of the item.

item:renamed

Item

Item

The renamed item.

OldName

string

The old name of the item.

item:sortorderchanged

Item

Item

The affected item.

OldValue

string

The previous item sort order.

item:templateChanged

Item

Item

The affected item.

TemplateChanges

TemplateChanges

Information about the changes made to the item's template.

publish:begin

publish:end

PublisherOptions

PublisherOptions

The basic publish information.

publish:statusUpdated

Status

StatusChanges

Publish progress information.

publish:fail

PublisherOptions

PublisherOptions

The basic publish information.

Exception

Exception

Information about the exception that occurred during publish attempt.

Sample webhook event handler request in JSON format

The following is an example of a webhook event handler request in JSON format, informing that an item was added:

RequestResponse
{
  "EventName": "item:added",
  "Item": {
    "Language": "en",
    "Version": 1,
    "Id": "4c3a401e-8b78-440a-bf88-736a71ce8e5a",
    "Name": "New sample item",
    "ParentId": "8fb31904-1bbc-463c-821b-c7c1a87bf13e",
    "TemplateId": "0133f52d-271f-4217-b1cd-04342e3457eb",
    "TemplateName": "Sample Item",
    "MasterId": "00000000-0000-0000-0000-000000000000",
    "SharedFields": [
      {
        "Id": "a4f985d9-98b3-4b52-aaaf-4344f6e747c6",
        "Value": "{88AD1387-D4DA-489D-BB4B-45540917E7ED}"
      }
    ],
    "UnversionedFields": [],
    "VersionedFields": [...]
  },
  "WebhookItemId": "95398c44-f232-41a8-b947-8aefec4ce6eb",
  "WebhookItemName": "Sample Webhook Event Handler"
}

Do you have some feedback for us?

If you have suggestions for improving this article,