Webhook REST API
The Webhook REST API lets you forward all audit logs from all supported Sitecore DXP applications to systems outside Sitecore. For example, to a security information and event management (SIEM) system, where you can analyze the recorded audit logs.
You can start forwarding all audit logs by creating and enabling a webhook. After creating at least one webhook, you can call the other API endpoints to, for example, update or disable the webhook.
Base URL
Your Webhook REST API base URL depends on the region of your Sitecore instance.
Sitecore region |
Webhook REST API base URL |
---|---|
AUE |
|
EUW |
|
JPE |
|
USE |
|
USW |
|
Your Sitecore region
You can find your Sitecore region by logging in to any of your Sitecore DXP apps supported by the Common Audit Log:
-
In Sitecore CDP, on the menu bar, click > Company information > Environment:
-
AP region means that your Sitecore region is AUE.
-
EU region means that your Sitecore region is EUW.
-
US region means that your Sitecore region is USE.
-
-
In Sitecore Connect, on the menu bar, in the last part of your tenant name:
-
Australia (East) means that your Sitecore region is AUE.
-
Europe (West) means that your Sitecore region is EUW.
-
Japan (East) means that your Sitecore region is JPE.
-
US East means that your Sitecore region is USE.
-
US West means that your Sitecore region is USW.
-
-
In Sitecore Personalize, on the menu bar, click > Company information > Environment:
-
AP region means that your Sitecore region is AUE.
-
EU region means that your Sitecore region is EUW.
-
US region means that your Sitecore region is USE.
-
Authentication
The Webhook REST API uses bearer authentication.
Bearer authentication involves sending a bearer token with every request. Only team members with an Organization Admin or Organization Owner role can access bearer tokens. To access your bearer token, log in to the Sitecore Cloud Portal, and in the the top-right corner of the menu bar, click your profile > API tokens. The bearer token is in the Bearer token field.
Bearer tokens expire in 15 minutes. If your requests unexpectedly return a response with status 401 Unauthorized
, refresh the API tokens page to access your new bearer token.
Webhook data model
When making requests to the Webhook REST API, you work with the following webhook attributes:
Attribute |
Type |
Description |
Example(s) |
---|---|---|---|
|
string |
The environment you are using the webhook in. This is a value of your choice. |
|
|
string |
The Sitecore digital experience platform (DXP) app to forward logs from. You must set this value to |
|
|
string |
The type of the system that logs will be forwarded to. You must set this value to |
|
|
string |
The secret for the webhook target. This value is automatically passed in the |
N/A |
|
string |
The webhook target URL. This is the URL that logs will be forwarded to. |
|
|
string |
The internal event name of when a webhook is created. You must set this value to |
|
|
boolean |
Determines whether the webhook is enabled or disabled at creation time. When enabled, logs will immediately start being forwarded to the webhook target URL. To change this after creating the webhook, see Disable a webhook and Enable a webhook. |
|
When receiving responses from the Webhook REST API, the following webhook attributes are returned:
Attribute |
Type |
Description |
Example(s) |
---|---|---|---|
|
string |
The webhook ID. |
|
|
string |
The ID of your organization. |
|
|
string |
The Sitecore digital experience platform (DXP) app to forward logs from. |
|
|
string |
The type of the system that logs will be forwarded to. |
|
|
string |
The secret for the webhook target. This value is automatically passed in the |
N/A |
|
string |
The webhook target URL. This is the URL that logs will be forwarded to. |
|
|
string |
The environment you are using the webhook in. This is a value of your choice. |
|
|
string |
The email address of the Sitecore Cloud Portal user that created the webhook. | |
|
string (ISO 8601) |
The UTC date and time when the webhook was created. |
|
|
string |
The unique identifier of the user that last updated the webhook. | |
|
string (ISO 8601) |
The UTC date and time when the webhook was last updated. |
|
|
string |
The internal event name of when a webhook is created. |
|
|
boolean |
Determines whether the webhook is enabled or disabled at creation time. When enabled, logs will immediately start being forwarded to the webhook target URL. |
|
Response codes
The Webhook REST API uses standard HTTP responses to let you know the result of your requests:
HTTP response |
Description |
---|---|
|
Webhook successfully retrieved. |
|
Webhook successfully created. |
|
You're not authorized to access the resource. Make sure to use a valid bearer token. |
|
Webhook not found. |