# Webhooks
#Available from v.3.11.0 Webhooks are used to notify external systems of changes within Struct PIM through a web request
GET /webhooks Get all configured webhooks
[
{
"Uid": "26ff0464-9a63-4119-93b1-8500ad32d3a1",
"Title": "Website integration",
"Url": "https://someeventhub.com/triggerme",
"Active": true,
"EnabledEvents": [
"variants:created",
"variants:updated",
"variants:deleted"
],
"AdvancedSettings": {
"variants:updated": {
"ConditionalTriggering": true,
"TriggerOnProductIdUpdates": false,
"TriggerOnVariantGroupIdUpdates": false,
"TriggerOnSortOrderUpdates": false,
"TriggerOnVariantGroupSortOrderUpdates": false,
"TriggerOnArchivingUpdates": false,
"TriggerOnAttributeUpdates": 2,
"DataModelType": 2
}
}
},
{
"Uid": "4d3291c1-05e5-4085-a7fa-95bc0db0edca",
"Title": "Website integration",
"Url": "https://integrations.com/productupdate",
"Active": true,
"EnabledEvents": [
"products:created",
"products:updated"
]
}
]
Response status OK (200)
| Property name | Data type | Description |
|---|---|---|
| Uid | string |
Unique id of webhook |
| Title | string |
Title of webhook |
| Url | string |
Url for the webhook to request when triggered |
| Active | boolean |
Activate / deactivate webhook |
| EnabledEvents | array |
Events this webhook shall act on |
| AdvancedSettings | object |
Advanced settings for events supporting this |
| RequestHeaders | array : RequestHeader |
Request headers to be added to webhook requests |
| Property name | Data type | Description |
|---|---|---|
| Name | string | |
| Value | string |
PUT /webhooks Update a webhook
{
"Uid": "64d3a37f-e3ba-44e4-bab1-0ee50fd00973",
"Title": "Website integration",
"Url": "https://someeventhub.com/triggerme",
"Active": true,
"EnabledEvents": [
"variants:created",
"variants:updated",
"variants:deleted"
],
"AdvancedSettings": {
"variants:updated": {
"ConditionalTriggering": true,
"TriggerOnProductIdUpdates": false,
"TriggerOnVariantGroupIdUpdates": false,
"TriggerOnSortOrderUpdates": false,
"TriggerOnVariantGroupSortOrderUpdates": false,
"TriggerOnArchivingUpdates": false,
"TriggerOnAttributeUpdates": 2,
"DataModelType": 2
}
}
}
Request parameters
| Property name | Parameter type | Data type | Description |
|---|---|---|---|
| webhook | body | object : WebhookModel |
Webhook to update |
| Property name | Data type | Description |
|---|---|---|
| Uid | string |
Unique id of webhook |
| Title | string |
Title of webhook |
| Url | string |
Url for the webhook to request when triggered |
| Active | boolean |
Activate / deactivate webhook |
| EnabledEvents | array |
Events this webhook shall act on |
| AdvancedSettings | object |
Advanced settings for events supporting this |
| RequestHeaders | array : RequestHeader |
Request headers to be added to webhook requests |
| Property name | Data type | Description |
|---|---|---|
| Name | string | |
| Value | string |
Response status OK (200)
POST /webhooks Create a new webhook
{
"Uid": "909feb08-a0ef-4d7b-8562-8481ea0b11d4",
"Title": "Website integration",
"Url": "https://someeventhub.com/triggerme",
"Active": true,
"EnabledEvents": [
"variants:created",
"variants:updated",
"variants:deleted"
],
"AdvancedSettings": {
"variants:updated": {
"ConditionalTriggering": true,
"TriggerOnProductIdUpdates": false,
"TriggerOnVariantGroupIdUpdates": false,
"TriggerOnSortOrderUpdates": false,
"TriggerOnVariantGroupSortOrderUpdates": false,
"TriggerOnArchivingUpdates": false,
"TriggerOnAttributeUpdates": 2,
"DataModelType": 2
}
}
}
Request parameters
| Property name | Parameter type | Data type | Description |
|---|---|---|---|
| webhook | body | object : WebhookModel |
Webhook to create |
| Property name | Data type | Description |
|---|---|---|
| Uid | string |
Unique id of webhook |
| Title | string |
Title of webhook |
| Url | string |
Url for the webhook to request when triggered |
| Active | boolean |
Activate / deactivate webhook |
| EnabledEvents | array |
Events this webhook shall act on |
| AdvancedSettings | object |
Advanced settings for events supporting this |
| RequestHeaders | array : RequestHeader |
Request headers to be added to webhook requests |
| Property name | Data type | Description |
|---|---|---|
| Name | string | |
| Value | string |
Response status OK (200)
GET /webhooks/{uid} Get a webhook
#Available from v.3.11.0
{
"Uid": "cf992bba-2fb2-4f1c-8255-17066a02f906",
"Title": "Website integration",
"Url": "https://someeventhub.com/triggerme",
"Active": true,
"EnabledEvents": [
"variants:created",
"variants:updated",
"variants:deleted"
],
"AdvancedSettings": {
"variants:updated": {
"ConditionalTriggering": true,
"TriggerOnProductIdUpdates": false,
"TriggerOnVariantGroupIdUpdates": false,
"TriggerOnSortOrderUpdates": false,
"TriggerOnVariantGroupSortOrderUpdates": false,
"TriggerOnArchivingUpdates": false,
"TriggerOnAttributeUpdates": 2,
"DataModelType": 2
}
}
}
Request parameters
| Property name | Parameter type | Data type | Description |
|---|---|---|---|
| uid | path | string |
Uid of webhook |
Response status OK (200)
| Property name | Data type | Description |
|---|---|---|
| Uid | string |
Unique id of webhook |
| Title | string |
Title of webhook |
| Url | string |
Url for the webhook to request when triggered |
| Active | boolean |
Activate / deactivate webhook |
| EnabledEvents | array |
Events this webhook shall act on |
| AdvancedSettings | object |
Advanced settings for events supporting this |
| RequestHeaders | array : RequestHeader |
Request headers to be added to webhook requests |
| Property name | Data type | Description |
|---|---|---|
| Name | string | |
| Value | string |
DELETE /webhooks/{uid} Delete a webhook
Request parameters
| Property name | Parameter type | Data type | Description |
|---|---|---|---|
| uid | path | string |
Uid of webhook to delete |
Response status OK (200)
GET /webhooks/{webhookUid}/requests Get requests made from a webhook. Note that webhook requests are only stored for 14 days
{
"WebhookRequests": [
{
"Uid": "715782e7-e7a6-4b81-859b-ba796959e702",
"WebhookUid": "578f4c10-0994-4c59-8bc1-39d0305ad94f",
"WebhookUrl": "https://structintegration.com/pimevent",
"EventKey": "products:updated",
"EventTimestamp": "2024-11-19T14:17:55.3327172+01:00",
"RequestTimestamp": "2024-11-19T14:17:55.3427172+01:00",
"RequestHeaders": {
"X-Event-Key": "products:updated",
"X-User": "support@struct.dk",
"X-Hook-UID": "578f4c10-0994-4c59-8bc1-39d0305ad94f",
"X-Request-UID": "715782e7-e7a6-4b81-859b-ba796959e702"
},
"RequestBody": "{\"ProductIds\":[2385147],\"TransactionUid\":\"40239249-8feb-4e22-b854-fd693ce1d8a7\"}",
"ElapsedMilliseconds": 57,
"ResponseCode": 200,
"ResponseHeaders": {
"Pragma": "no-cache",
"Cache-Control": "no-cache",
"Date": "Fri, 03 Feb 2023 13:07:40 GMT"
},
"IsRetry": false
}
],
"Page": 1,
"TotalHits": 1
}
Request parameters
| Property name | Parameter type | Data type | Description |
|---|---|---|---|
| webhookUid | path | string |
Uid of webhook |
| since | query | string |
return webhook requests newer than this timestamp |
| onlyFailed | query | boolean |
Only return failed webhook requests |
| page | query | integer |
Page to get (1 is first page) |
Response status OK (200)
| Property name | Data type | Description |
|---|---|---|
| WebhookRequests | array : WebhookRequestModel |
Webhook requests that matched the criteria |
| Page | integer |
Page of the search request |
| TotalHits | integer |
Total number of hits in the search |
| Property name | Data type | Description |
|---|---|---|
| Uid | string |
Unique id of this webhook request (Passed in the X-Request-UID header of the request) |
| WebhookUid | string |
Unique id of the webhook that triggered the request (Passed in the X-Hook-UID header of the request) |
| WebhookUrl | string |
Url that was called |
| EventKey | string |
The key of the event that triggered the event (Passed in the X-Event-Key header of the request) |
| EventTimestamp | string |
Timestamp of the event that triggered the webhook request |
| RequestTimestamp | string |
Timestamp of when the webhook request was made |
| RequestHeaders | object |
The request headers sent in the webhook request |
| RequestBody | string |
The request body sent in the webhook request |
| ElapsedMilliseconds | integer |
The time in ms it took to get a response from the recipient of the request |
| ResponseCode | integer |
The response code of the webhook request |
| ResponseHeaders | object |
The response headers received from the request |
| ParentWebhookRequestUid | string |
Uid of parent webhook request (only has value, if this is a retry of a failed webhook requeest) |
| IsRetry | boolean |
Indicates whether this request is a retry of a previously failed request |
GET /webhooks/{webhookUid}/requests/{requestUid} Get a specific request made from a webhook. Note that webhook requests are only stored for 14 days
{
"Uid": "715782e7-e7a6-4b81-859b-ba796959e702",
"WebhookUid": "578f4c10-0994-4c59-8bc1-39d0305ad94f",
"WebhookUrl": "https://structintegration.com/pimevent",
"EventKey": "products:updated",
"EventTimestamp": "2024-11-19T14:17:55.3347669+01:00",
"RequestTimestamp": "2024-11-19T14:17:55.3447669+01:00",
"RequestHeaders": {
"X-Event-Key": "products:updated",
"X-User": "support@struct.dk",
"X-Hook-UID": "578f4c10-0994-4c59-8bc1-39d0305ad94f",
"X-Request-UID": "715782e7-e7a6-4b81-859b-ba796959e702"
},
"RequestBody": "{\"ProductIds\":[2385147],\"TransactionUid\":\"40239249-8feb-4e22-b854-fd693ce1d8a7\"}",
"ElapsedMilliseconds": 57,
"ResponseCode": 200,
"ResponseHeaders": {
"Pragma": "no-cache",
"Cache-Control": "no-cache",
"Date": "Fri, 03 Feb 2023 13:07:40 GMT"
},
"IsRetry": false
}
Request parameters
| Property name | Parameter type | Data type | Description |
|---|---|---|---|
| webhookUid | path | string |
Uid of webhook |
| requestUid | path | string |
Uid of webhook request |
Response status OK (200)
| Property name | Data type | Description |
|---|---|---|
| Uid | string |
Unique id of this webhook request (Passed in the X-Request-UID header of the request) |
| WebhookUid | string |
Unique id of the webhook that triggered the request (Passed in the X-Hook-UID header of the request) |
| WebhookUrl | string |
Url that was called |
| EventKey | string |
The key of the event that triggered the event (Passed in the X-Event-Key header of the request) |
| EventTimestamp | string |
Timestamp of the event that triggered the webhook request |
| RequestTimestamp | string |
Timestamp of when the webhook request was made |
| RequestHeaders | object |
The request headers sent in the webhook request |
| RequestBody | string |
The request body sent in the webhook request |
| ElapsedMilliseconds | integer |
The time in ms it took to get a response from the recipient of the request |
| ResponseCode | integer |
The response code of the webhook request |
| ResponseHeaders | object |
The response headers received from the request |
| ParentWebhookRequestUid | string |
Uid of parent webhook request (only has value, if this is a retry of a failed webhook requeest) |
| IsRetry | boolean |
Indicates whether this request is a retry of a previously failed request |