Request Structure
A subscriber receives one HTTP request per triggering event. The method depends on the event, POST for postAdd,
PUT for postUpdate and the workflow events, DELETE for postDelete. The full mapping is in
Events and Schema.
Any custom headers configured for the webhook are sent with the request.
The JSON body has two sections, general and subject. Workflow events add a third one, workflowData.
General
The general section describes the event itself.
"general": {
"eventName": "pimcore.dataobject.postUpdate",
"timestamp": 1653303523,
"subjectType": "object",
"versionOnly": true
}
| Field | Meaning |
|---|---|
eventName | The Pimcore event that triggered the webhook. |
timestamp | Unix timestamp of the dispatch. |
subjectType | The element type: object, asset or document. |
versionOnly | true when only a version (a draft) was saved, rather than the element itself. |
Subject
The subject section carries the element data selected in the schema definition. For assets with binary data enabled,
it also contains the base64-encoded contents in a data64 field.
"subject": {
"id": 81,
"path": "/Product Data/Cars/shelby/cobra-427",
"name": "Cobra 427",
"description": null,
"userModification": 25,
"userModificationName": "admin",
"published": true,
"type": "Car"
}
id and path are present for every element type. Data object fields use the key of the selected column, which is the
field name, so a column for the name field is sent as "name". Data objects additionally always carry
userModification, userModificationName, published and type (the class name). Assets and documents use the fixed
keys shown in the examples below.
Asset relation fields are not sent as a path string. They are expanded into an object with id, path and type,
where path is an absolute URL when the request context provides a host.
Examples
Data Objects
{
"general": {
"eventName": "pimcore.dataobject.postUpdate",
"timestamp": 1690975273,
"subjectType": "object",
"versionOnly": false
},
"subject": {
"id": 260,
"path": "/Product Data/Cars/alfa romeo/1900",
"name": "1900",
"description": "<p>The Alfa Romeo 1900 is an automobile produced by Alfa Romeo from 1950 to 1959.</p>",
"userModification": 25,
"userModificationName": "admin",
"published": false,
"type": "Car"
}
}
Assets
{
"general": {
"eventName": "pimcore.asset.postUpdate",
"timestamp": 1690975091,
"subjectType": "asset",
"versionOnly": false
},
"subject": {
"id": 83,
"path": "/Car Images/ferrari/061_-_Ferrari_Testarossa_-_Flickr_-_Price-Photography.jpg",
"userModification": 25,
"userModificationName": "admin",
"type": "image",
"mimeType": "image/jpeg"
}
}
With Include Image data set to a thumbnail or to the original format, the subject section additionally contains a
data64 field with the base64-encoded image.
Documents
{
"general": {
"eventName": "pimcore.document.postUpdate",
"timestamp": 1690975115,
"subjectType": "document",
"versionOnly": false
},
"subject": {
"id": 65,
"path": "/en/News",
"userModification": 25,
"userModificationName": "admin",
"published": true,
"type": "page"
}
}
Workflows
workflow.entered and workflow.completed prepend a workflowData section to the body. general and subject
follow, built from the element the workflow ran on.
{
"workflowData": {
"workflow": {
"name": "product_approval"
},
"transition": {
"name": "submit",
"options": [],
"froms": ["draft"],
"tos": ["review"]
},
"marking": {
"places": {
"review": 1
}
}
},
"general": {
"eventName": "workflow.entered",
"timestamp": 1690975273,
"subjectType": "object",
"versionOnly": false
},
"subject": {
"id": 260,
"path": "/Product Data/Cars/alfa romeo/1900",
"userModification": 25,
"userModificationName": "admin",
"published": true,
"type": "Car"
}
}
transition is an empty array when the event carries no transition, for example on workflow.entered for the initial
place. options holds the transition options from the workflow configuration.
The subject section is built by the same extractor as for element events, so a workflow on a data object still needs
its class configured under Schema Definition Data Objects. Without it there is no field selection to extract.
Changing the Payload
To send a payload the standard processors cannot produce, implement a custom processor. See Custom Processors.