Webhook objects

Version:

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.

NameTypeDescription
labelstringDescribes the purpose of the webhook.
uriUriThe URI to make the web request to.
methodstringThe HTTP method to use when making the web request. Must be GET or POST.
headersobjectCustom headers to send when making the web request. Commonly used for authentication.
bodystringThe body to post when making the web request. Only populated if ExecutionMode is OnEnd.
bodyIncludestringAdditional 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.
createdBystringThe name of the user who created the webhook.
executionModestringDetermines how the webhook is executed. Must be one of the following options: OnEnd, OnUpdate.

Example:

{
  "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.

NameTypeDescription
idstringThe identifier for this webhook.
tenantIdstringThe ID of the tenant this webhook belongs to.
labelstringDescribes the purpose of the webhook.
uriUriThe URI to make the web request to.
methodstringThe HTTP method to use when making the web request. Must be GET or POST.
headersobjectCustom headers to send when making the web request. Commonly used for authentication.
bodystringThe body to post when making the web request. Only populated if ExecutionMode is OnEnd.
bodyIncludestringAn 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.
createdBystringThe name of the user who created the webhook.
createdDateTimeOffsetThe timestamp when the webhook was created.
executionModestringDetermines how the webhook is executed. Must be one of the following options: OnEnd, OnUpdate.
lastRunsarray of objectsThe results of the latest executions of the webhook. The following table describes the lastRuns object.

The lastRuns object

The lastRuns object can contain the following fields:

NameTypeDescription
timestampDateTimeOffsetThe timestamp when the execution log was created.
successBooleanIndicates whether the webhook ran successfully.
messagestringIn case the webhook failed, the error message.

Example:

{
  "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.

NameTypeDescription
identifierstringThe identifier of the entity.
entity_definitionstringThe entity definition that the entity uses. Only populated for an update operation.
operationstringThe type of operation executed: update or delete.

Example:

{
  "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.

NameTypeDescription
invocation_idGUIDIdentifies the invocation of the webhook. Used to correlate across large counts of updates spanning across multiple webhook requests.
updatesarray of EntityUpdateThe entities that were updated and caused the webhook execution.
continuesboolIndicates 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.

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:

{
  "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
}
If you have suggestions for improving this article, let us know!