---
title: "Webhook objects"
slug: "webhook-objects"
abstract: "The webhook JSON objects that interact with the Edge Admin API endpoint, for integrating XM publishing flows."
---
# Webhook objects

A webhook is a way for a service to provide other applications with real-time information. Webhooks trigger external builds of consuming applications when a publishing operation is complete.

The following tables list the various JSON objects used within the webhooks endpoint of the Edge Admin API.

## WebhookEdit

The properties used to create or update a webhook, when calling the `CreateWebhook` or `UpdateWebhook` [Admin endpoints](https://doc.sitecore.com/xp/en/developers/hd/23/sitecore-headless-development/admin-api.html "Admin API").

| Name | Type | Description |
| --- | --- | --- |
| label | string | Describes the purpose of the webhook. |
| uri | Uri | The URI to make the web request to. |
| method | string | The HTTP method to use when making the web request. Must be `GET` or `POST`. |
| headers | object | Custom headers to send when making the web request. Commonly used for authentication. |
| body | string | The body to post when making the web request. Only populated if `ExecutionMode` is `OnEnd`. |
| bodyInclude | string | Additional JSON object to include in the body of the webhook request. Only populated if `ExecutionMode` is `OnUpdate`. This field must be a valid JSON object. |
| createdBy | string | The name of the user who created the webhook. |
| executionMode | string | Determines how the webhook is executed. Must be one of the following options: `OnEnd`, `OnUpdate`. |

Example:

```csharp
{
  "label": "My new webhook",
  "uri": "https://www.mysite.com/hooks/edge-hook",
  "method": "POST",
  "headers": {
    "x-header": "bar"
  },
  "body": "{\"rebuild\":\"true\"}",
  "createdBy": "anco",
  "executionMode": "OnEnd"
}

```

## Webhook

Describes the webhook.

| Name | Type | Description |
| --- | --- | --- |
| id | string | The identifier for this webhook. |
| tenantId | string | The ID of the tenant this webhook belongs to. |
| label | string | Describes the purpose of the webhook. |
| uri | Uri | The URI to make the web request to. |
| method | string | The HTTP method to use when making the web request. Must be GET or POST. |
| headers | object | Custom headers to send when making the web request. Commonly used for authentication. |
| body | string | The body to post when making the web request. Only populated if `ExecutionMode` is `OnEnd`. |
| bodyInclude | string | An additional JSON object to include in the body of the webhook request. Can only be populated if ExecutionMode is OnUpdate. This field must be a valid JSON object. |
| createdBy | string | The name of the user who created the webhook. |
| created | DateTimeOffset | The timestamp when the webhook was created. |
| executionMode | string | Determines how the webhook is executed. Must be one of the following options: `OnEnd`, `OnUpdate`. |
| lastRuns | array of objects | The results of the latest executions of the webhook. The following table describes the `lastRuns` object. |

### The lastRuns object { .notintoc }

The `lastRuns` object can contain the following fields:

| Name | Type | Description |
| --- | --- | --- |
| timestamp | DateTimeOffset | The timestamp when the execution log was created. |
| success | Boolean | Indicates whether the webhook ran successfully. |
| message | string | In case the webhook failed, the error message. |

Example:

```csharp
{
  "id": "5678",
  "tenantId": "acme-corp",
  "label": "webhook 29",
  "uri": "https://www.acme.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-16T10:`10:53`.825Z",
      "success": true
    },
    {
        "timestamp": "2024-05-30T09:`50:53`.2134315+`00:00`",
        "success": false,
        "message": "Internal service error"
    }
  ],
  "disabled": false
}

```

## EntityUpdate

Describes an entity that was updated and caused the webhook execution.

| Name | Type | Description |
| --- | --- | --- |
| identifier | string | The identifier of the entity. |
| entity_definition | string | The entity definition that the entity uses. Only populated for an update operation. |
| operation | string | The type of operation executed: `update` or `delete`. |

Example:

```csharp
{
  "identifier": "B43D07BD61D5448F93238B6ACAD4F3C4",
  "entity_definition": "Item",
  "operation": "Update",
  "entity_culture": "en"
}

```

## WebHookRequest

The body of a request made to a webhook endpoint that uses the `OnUpdate` execution mode.

| Name | Type | Description |
| --- | --- | --- |
| invocation_id | GUID | Identifies the invocation of the webhook. Used to correlate across large counts of updates spanning across multiple webhook requests. |
| updates | array of EntityUpdate | The entities that were updated and caused the webhook execution. |
| continues | bool | Indicates whether there will be an additional request to continue sending more updates. This occurs when there are a large number of updates and they are split between multiple requests.<br><br>If the field is populated, this JSON object is merged into the body of the request with properties of the object being injected into the request body object. |

Example:

```csharp
{
  "invocation_id": "6a271d7b-92de-4d14-8002-8fc97a46c290",
  "updates": [
        {
            "identifier": "B43D07BD61D5448F93238B6ACAD4F3C4",
            "entity_definition": "Item",
            "operation": "Update",
            "entity_culture": "en"
        },
        {
            "identifier": "siteName",
            "entity_definition": "SiteInfo",
            "operation": "Update",
            "entity_culture": "all"
        },
        {
            "identifier": "3CE9A090FB9B42BEB593F39BFCB1DE2B",
            "entity_definition": "Item",
            "operation": "Update",
            "entity_culture": "en"
        }
      ],
  "continues": false
}

```