Webhook objects

Current version: 21.x

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

Edits a webhook. Data used to create or update a webhook.

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:

RequestResponse
{
  "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 used to identify 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.

Example:

RequestResponse
{
  "id": "5678",
  "tenantId": "target-corp",
  "label": "webhook 29",
  "uri": "https://www.target-domain-of-the-webhook.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"
}

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:

RequestResponse
{
  "identifier": "M.Setting.CleanerInterval",
  "entity_definition": "M.Setting",
  "operation": "update"
}

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.

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:

RequestResponse
{
  "invocation_id": "7734f16b-1e46-4321-a40e-522255d6c17a",
  "updates": [
    {
      "identifier": "M.Setting.CleanerInterval",
      "entity_definition": "M.Setting",
      "operation": "update"
    },
    {
      "identifier": "Content.PowerFromWithin",
      "operation": "delete"
    }
  ],
  "continues": false
}

Do you have some feedback for us?

If you have suggestions for improving this article,