Webhooks

Glia allows integrators to register webhooks which will subscribe to certain events. When an event occurs we'll send either an Apple push notification (APN) or a HTTP request to the configured URL with the specified HTTP method and headers.

You can specify up to 10 webhooks at a time. Those webhooks can include both HTTP or APN webhooks.

HTTP webhook

Registering

The format for specifying a HTTP webhook is:

Field

Required

Type

Description

url

Yes

String

The URL (including protocol) to which the HTTP request will be sent to.

method

Yes

String

The HTTP method (e.g POST, PATCH) that will be used for the HTTP request.

headers

No

Object

An arbitrary object which will be used to set request headers for the HTTP request. The keys of the object will be used as header names and values as header values. This can be used to authenticate incoming HTTP requests in your server.

events

Yes

Array of Strings

An array of events (at least one) upon which a HTTP request will be made.

Payload

When using a HTTP webhook, the server sends a JSON payload as defined in the events.

Apple push notification webhook

Registering

Compared to HTTP webhooks, the URL must be defined in the apns schema. Also, the method and header fields are not allowed.

Field

Required

Type

Description

url

Yes

String

The URI using the apns scheme

events

Yes

Array of Strings

An array of events (at least one) upon which a push notification will be sent.

apns://device_token@topic?key=value&key2=value2

The apns scheme is an URI that denotes the push notification target.

  • device_token is the Apple device token

  • topic is the

    bundle ID

  • additional query parameters can be added after topic

Query parameters

Field

Required

Type

Description

Note

env

Yes

String

The target environment. One of sandbox, production

If sandbox, the Apple development push notification server is used.

content_available

No

Boolean

true for silent notification

false by default

Example of an APN webhook definition

{
"url": "apns://93af82c6cfa56172901e191d07fdcacfb7cc01c13ed06cc73c6ce8ee1fdee355@org.myapp.demo?env=sandbox",
"events": ["engagement.start"]
}

Payload

The event payload is wrapped in the data object. The payload contains additional push notification specific fields.

Field

Type

Description

message

String

Same as event.event_type

content_available

Boolean

Enables silent notification

data

Object

The event payload as defined in events.

Example of an engagement.start notification sent by the server:

{
"message": "engagement.start",
"content_available": false,
"data": {
"event_type": "engagement.start",
"event_id": "5cfb83e9-9b29-492c-b8d9-ded81beb8121",
"dispatched_at": "2017-01-01T00:00:00.0Z",
"engagement": {
"id": "584714ac-ac69-4beb-8b78-1bd7064f2356",
"engagement_request_id": "ca0baa1f-7214-4892-b651-40abd3f429fb",
"visitor_id": "eace7e6a-7e09-492b-84a4-150a7b894353",
"current_sub_engagement": {
"id": "24",
"operator_id": "858884a0-ccbd-4188-96ff-87691d2ca2b9",
"site_id": "375025a4-8b8f-418c-8236-593ac4098a56"
}
}
}
}

Events

The available events are:

Type

Trigger

engagement.request.failure

When the engagement request ends without resulting in an Engagement (i.e canceled, timed out).

engagement.request.deliver

When the engagement request has been delivered. This only occurs for engagement requests created for Outbound SMS.

engagement.start

When an engagement starts.

engagement.end

When the engagement ends.

engagement.transfer

When the engagement is transferred to a new operator.

engagement.chat.message

When a chat message is sent.

engagement.chat.message.status

When the status of chat message changes.

engagement.chat.system_message

When a generated by a system message is sent.

engagement.chat.typing_indicator.operator

When operator typing indicator is updated.

engagement.media_upgrade_request

When a media upgrade request is created.

engagement.event

When the Visitor Event is sent.

visitor.authentication.success

When the Visitor Authentication Request is successful.

visitor.authentication.failure

When the Visitor Authentication Request is unsuccessful.

sip_domain.delete

When SIP domain is deleted.

engagement.files.security_scan_result

When the uploaded file has been scanned.

All events are documented as JSON schemas. Also, an example is given for each event.

Common fields

Each event has a specific payload which is described in the event description. All events have the following common fields:

Field

Type

Description

event_type

String

The type of the event as specified in the event description.

event_id

String

An ID that uniquely identifies the Event.

dispatched_at

String

A timestamp with the following ISO-8601 format: YYYY-MM-DDThh:mm:ss.sTZD (ISO-8601).

EngagementRequestFailureEvent

Fired when an engagement request ends without accepting.

fail_message is only present when fail_reason is error. Note that even then, its value can still be null.

{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Description of engagement.request.failure event",
"type": "object",
"properties": {
"event_type": {"const": "engagement.request.failure"},
"event_id": {"type": "string"},
"dispatched_at": {"type": "string", "format": "date-time"},
"engagement_request": {
"type": "object",
"properties": {
"id": {"type": "string"},
"site_id": {"type": "string"},
"visitor_id": {"type": "string"},
"operator_id": {"type": "string"},
"fail_reason": {
"type": "string",
"enum": [
"rejected",
"timed_out",
"visitor_left",
"visitor_cancel",
"operator_left",
"operator_cancel",
"error"
]
},
"fail_message": {"type": ["string", "null"]}
}
}
}
}
{
"event_type": "engagement.request.failure",
"event_id": "e8bacbef-fee6-4bb7-8c02-b7b1871b98d9",
"dispatched_at": "2017-01-01T00:00:00.0Z",
"engagement_request": {
"id": "5fc202a2-37a0-420f-b57f-1fbad68f4a0f",
"site_id": "24fa79ca-ca67-45e7-a94c-b5fc98590c39",
"visitor_id": "eace7e6a-7e09-492b-84a4-150a7b894353",
"operator_id": "31d03cfa-e563-436c-818a-e3242138bd94",
"fail_reason": "visitor_cancel",
"fail_message": null
}
}

EngagementRequestDeliveryEvent

Fired when engagement request has been delivered. This currently only occurs for engagement requests created for Outbound SMS, but may also be triggered for other types of engagement requests in the future.

{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Description of engagement.request.deliver event",
"type": "object",
"properties": {
"event_type": {"const": "engagement.request.deliver"},
"event_id": {"type": "string"},
"dispatched_at": {"type": "string", "format": "date-time"},
"engagement_request": {
"type": "object",
"properties": {
"id": {"type": "string"},
"site_id": {"type": "string"},
"visitor_id": {"type": "string"},
"operator_id": {"type": "string"}
}
}
}
}
{
"event_type": "engagement.request.deliver",
"event_id": "e8bacbef-fee6-4bb7-8c02-b7b1871b98d9",
"dispatched_at": "2017-01-01T00:00:00.0Z",
"engagement_request": {
"id": "5fc202a2-37a0-420f-b57f-1fbad68f4a0f",
"site_id": "24fa79ca-ca67-45e7-a94c-b5fc98590c39",
"visitor_id": "eace7e6a-7e09-492b-84a4-150a7b894353",
"operator_id": "31d03cfa-e563-436c-818a-e3242138bd94"
}
}

EngagementStartEvent

Fired when an engagement starts. As an engagement can be transferred and therefore can span across multiple sites and different operators, all engagement events contain the field current_sub_engagement which includes the current operator and site ID. To end the engagement, see End Engagement.

{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Description of engagement.start event",
"type": "object",
"properties": {
"event_type": {"const": "engagement.start"},
"event_id": {"type": "string"},
"dispatched_at": {"type": "string", "format": "date-time"},
"engagement": {
"type": "object",
"properties": {
"id": {"type": "string"},
"engagement_request_id": {"type": "string"},
"visitor_id": {"type": "string"},
"current_sub_engagement": {
"type": "object",
"properties": {
"id": {"type": "string"},
"operator_id": {"type": "string"},
"site_id": {"type": "string"}
}
}
}
}
}
}
{
"event_type": "engagement.start",
"event_id": "e8bacbef-fee6-4bb7-8c02-b7b1871b98d9",
"dispatched_at": "2017-01-01T00:00:00.0Z",
"engagement": {
"id": "c71379b7-4e32-4dd4-a549-04f90f959dd5",
"engagement_request_id": "5fc202a2-37a0-420f-b57f-1fbad68f4a0f",
"visitor_id": "eace7e6a-7e09-492b-84a4-150a7b894353",
"current_sub_engagement": {
"id": "fc3aa55f-e6ad-4f4f-9b6b-28541d316a4c",
"operator_id": "31d03cfa-e563-436c-818a-e3242138bd94",
"site_id": "4afaf91f-b2a2-4eba-b617-76c415137d7c"
}
}
}

EngagementEndEvent

Fired when an engagement ends. The last operator and site of the engagement are given in the current_sub_engagement field. The reason for ending is given in the end_reason field, an error reason notes that either the visitor or operator suffered an application failure when trying to start an engagement in their respective applications.

{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Description of engagement.end event",
"type": "object",
"properties": {
"event_type": {"const": "engagement.end"},
"event_id": {"type": "string"},
"dispatched_at": {"type": "string", "format": "date-time"},
"engagement": {
"type": "object",
"properties": {
"id": {"type": "string"},
"engagement_request_id": {"type": "string"},
"visitor_id": {"type": "string"},
"end_reason": {
"enum": [
"visitor_hung_up",
"operator_hung_up",
"visitor_left",
"operator_left",
"error"
]
},
"current_sub_engagement": {
"type": "object",
"properties": {
"id": {"type": "string"},
"operator_id": {"type": "string"},
"site_id": {"type": "string"}
}
}
}
}
}
}
{
"event_type": "engagement.end",
"event_id": "e8bacbef-fee6-4bb7-8c02-b7b1871b98d9",
"dispatched_at": "2017-01-01T00:00:00.0Z",
"engagement": {
"id": "c71379b7-4e32-4dd4-a549-04f90f959dd5",
"engagement_request_id": "5fc202a2-37a0-420f-b57f-1fbad68f4a0f",
"visitor_id": "eace7e6a-7e09-492b-84a4-150a7b894353",
"current_sub_engagement": {
"id": "fc3aa55f-e6ad-4f4f-9b6b-28541d316a4c",
"operator_id": "31d03cfa-e563-436c-818a-e3242138bd94",
"site_id": "4afaf91f-b2a2-4eba-b617-76c415137d7c"
},
"end_reason": "visitor_hung_up"
}
}

EngagementTransferEvent

Fired when an engagement is transferred from one operator to another, while the visitor of the engagement remains the same. The previous_sub_engagement field contains the operator and site of the engagement prior to the transfer, current_sub_engagement field contains the operator and site after the transfer.

{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Description of engagement.transfer event",
"type": "object",
"properties": {
"event_type": {"const": "engagement.transfer"},
"event_id": {"type": "string"},
"dispatched_at": {"type": "string", "format": "date-time"},
"engagement": {
"type": "object",
"properties": {
"id": {"type": "string"},
"engagement_request_id": {"type": "string"},
"transfer_request_id": {"type": "string"},
"visitor_id": {"type": "string"},
"previous_sub_engagement": {
"type": "object",
"properties": {
"id": {"type": "string"},
"operator_id": {"type": "string"},
"site_id": {"type": "string"}
}
},
"current_sub_engagement": {
"type": "object",
"properties": {
"id": {"type": "string"},
"operator_id": {"type": "string"},
"site_id": {"type": "string"}
}
}
}
}
}
}
{
"event_type": "engagement.transfer",
"event_id": "e8bacbef-fee6-4bb7-8c02-b7b1871b98d9",
"dispatched_at": "2017-01-01T00:00:00.0Z",
"engagement": {
"id": "c71379b7-4e32-4dd4-a549-04f90f959dd5",
"engagement_request_id": "5fc202a2-37a0-420f-b57f-1fbad68f4a0f",
"transfer_request_id": "133f2686-41af-47af-b8bb-13172b65469b",
"visitor_id": "eace7e6a-7e09-492b-84a4-150a7b894353",
"current_sub_engagement": {
"id": "fc3aa55f-e6ad-4f4f-9b6b-28541d316a4c",
"operator_id": "31d03cfa-e563-436c-818a-e3242138bd94",
"site_id": "4afaf91f-b2a2-4eba-b617-76c415137d7c"
},
"previous_sub_engagement": {
"id": "32c383c1-a00e-491d-9463-a5bd44e004e5",
"operator_id": "8f9582fc-8a2e-4f01-a3a1-1ffb0abee9da",
"site_id": "4afaf91f-b2a2-4eba-b617-76c415137d7c"
}
}
}

ChatMessageCreatedEvent

Fired when a chat message is sent by one engagement participant.

  • The content field includes the message content.

  • The sender is either the visitor or operator of the engagement.

    Note that this event is sent to the sender of the message.

  • The target is the recipient of the message. Can be either visitor or operator.

  • The type specifies the message type. In the context of the

    ChatMessageCreatedEvent the only possible value is chat, for regular chat

    messages. Note that SystemMessageEvent webhook uses different type values."

  • The undelivered_messages field is set to true if any

    engagement.chat.message events prior to this one have not been successfully

    delivered to the recipient.

  • The timestamp field is set to server time at the moment that the server

    receives the message.

  • For files attachments, the URL can be used to download the file but it

    requires the same authorization as fetching chat transcript.

{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Description of engagement.chat.message event",
"type": "object",
"properties": {
"event_type": {"const": "engagement.chat.message"},
"event_id": {"type": "string"},
"dispatched_at": {"type": "string", "format": "date-time"},
"message": {
"type": "object",
"properties": {
"timestamp": {"type": "string", "format": "date-time"},
"id": {"type": "string"},
"engagement_id": {"type": "string"},
"sub_engagement_id": {"type": "string"},
"content": {"type": "string"},
"status": {"const": "sent"},
"sender": {
"type": "object",
"properties": {
"type": {"enum": ["visitor", "operator"]}
}
},
"target": {"enum": ["visitor", "operator"]},
"type": {"enum": ["chat"]},
"attachment": {
"oneOf": [
{"type": "null"},
{"$ref": "#/definitions/attachment_single_choice"},
{"$ref": "#/definitions/attachment_single_choice_response"},
{"$ref": "#/definitions/attachment_files"}
]
}
}
},
"undelivered_messages": {"type": "boolean"}
},
"definitions": {
"attachment_single_choice": {
"type": "object",
"properties": {
"type": {"const": "single_choice"},
"image_url": {"type": "string"},
"options": {
"type": "array",
"items": {
"type": "object",
"properties": {
"text": {"type": "string"},
"value": {"type": "string"}
}
}
}
},
"required": ["type", "options"]
},
"attachment_single_choice_response": {
"type": "object",
"properties": {
"type": {"const": "single_choice_response"},
"selected_option": {"type": "string"}
}
},
"attachment_files": {
"type": "object",
"properties": {
"type": {"const": "files"},
"files": {
"type": "array",
"items": {
"type": "object",
"properties": {
"url": {"type": "string"},
"name": {"type": "string"},
"content_type": {"type": "string"},
"deleted": {"type": "boolean"}
}
}
}
}
}
}
}
{
"event_type": "engagement.chat.message",
"event_id": "e8bacbef-fee6-4bb7-8c02-b7b1871b98d9",
"dispatched_at": "2017-01-01T00:00:00.0Z",
"message": {
"timestamp": "2017-01-01T00:00:00.0Z",
"id": "388c4a1f-3e08-4cf6-b8ae-d290c07dc61f",
"engagement_id": "c71379b7-4e32-4dd4-a549-04f90f959dd5",
"sub_engagement_id": "fc3aa55f-e6ad-4f4f-9b6b-28541d316a4c",
"content": "message-content",
"status": "sent",
"sender": {
"type": "operator"
},
"target": "visitor",
"attachment": {
"type": "single_choice",
"image_url": "https://s3.amazonaws.com/hosting-elements.glia.com/Glia-OG.png",
"options": [
{
"text": "Choice 1",
"value": "choice_1"
},
{
"text": "Choice 2",
"value": "choice_2"
},
{
"text": "Choice 3",
"value": "choice_3"
}
]
}
},
"undelivered_messages": false
}

ChatMessageStatusEvent

Fired when a chat message is successfully delivered to the recipient. Note that this event is only sent to the sender of the message.

{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Description of engagement.chat.message_status event",
"type": "object",
"properties": {
"event_type": {"const": "engagement.chat.message_status"},
"event_id": {"type": "string"},
"dispatched_at": {"type": "string", "format": "date-time"},
"message": {
"type": "object",
"properties": {
"timestamp": {"type": "string", "format": "date-time"},
"id": {"type": "string"},
"engagement_id": {"type": "string"},
"sub_engagement_id": {"type": "string"},
"content": {"type": "string"},
"status": {"const": "delivered"},
"sender": {
"type": "object",
"properties": {
"type": {"enum": ["visitor", "operator"]}
}
},
"target": {"enum": ["visitor", "operator"]},
"type": {"enum": ["chat"]},
"attachment": {
"oneOf": [
{"type": "null"},
{"$ref": "#/definitions/attachment_single_choice"},
{"$ref": "#/definitions/attachment_single_choice_response"}
]
}
}
}
},
"definitions": {
"attachment_single_choice": {
"type": "object",
"properties": {
"type": {"const": "single_choice"},
"image_url": {"type": "string"},
"options": {
"type": "array",
"items": {
"type": "object",
"properties": {
"text": {"type": "string"},
"value": {"type": "string"}
}
}
}
},
"required": ["type", "options"]
},
"attachment_single_choice_response": {
"type": "object",
"properties": {
"type": {"const": "single_choice_response"},
"selected_option": {"type": "string"}
}
}
}
}
{
"event_type": "engagement.chat.message_status",
"event_id": "e8bacbef-fee6-4bb7-8c02-b7b1871b98d9",
"dispatched_at": "2017-01-01T00:00:00.0Z",
"message": {
"timestamp": "2017-01-01T00:00:00.0Z",
"id": "388c4a1f-3e08-4cf6-b8ae-d290c07dc61f",
"engagement_id": "c71379b7-4e32-4dd4-a549-04f90f959dd5",
"sub_engagement_id": "fc3aa55f-e6ad-4f4f-9b6b-28541d316a4c",
"content": "message-content",
"status": "delivered",
"sender": {
"type": "operator"
},
"target": "visitor",
"attachment": {
"type": "single_choice",
"image_url": "https://s3.amazonaws.com/hosting-elements.glia.com/Glia-OG.png",
"options": [
{
"text": "Choice 1",
"value": "choice_1"
},
{
"text": "Choice 2",
"value": "choice_2"
},
{
"text": "Choice 3",
"value": "choice_3"
}
]
}
}
}

SystemMessageEvent

Fired when a system message is sent to operator.

  • The content field includes the message content.

  • The sender is either:

    • system - for media upgrade messages and other system notifications

    • omniguide - for AI Management module prompts and suggestions

  • The target is the recipient of the message. Can be only operator. More

    targets might be added in future.

  • The type is either:

    • system_message - default type for system messages, a regular chat message.

    • visitor_authentication - used to indicate successful Visitor

      Authentication.

  • The timestamp field is set to server time at the moment when the message is

    generated.

  • The metadata is an arbitrary message metadata specified by sender.

{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Description of engagement.chat.system_message event",
"type": "object",
"properties": {
"event_type": {"const": "engagement.chat.system_message"},
"event_id": {"type": "string"},
"dispatched_at": {"type": "string", "format": "date-time"},
"message": {
"type": "object",
"properties": {
"timestamp": {"type": "string", "format": "date-time"},
"id": {"type": "string"},
"engagement_id": {"type": "string"},
"sub_engagement_id": {"type": "string"},
"content": {"type": "string"},
"status": {"const": "sent"},
"sender": {
"type": "object",
"properties": {
"type": {"enum": ["system", "omniguide"]}
}
},
"target": {"enum": ["operator"]},
"type": {"enum": ["system_message", "visitor_authentication"]},
"attachment": {
"oneOf": [
{"type": "null"},
{"$ref": "#/definitions/attachment_single_choice" },
{"$ref": "#/definitions/attachment_single_choice_response" }
]
},
"metadata": {
"oneOf": [
{"type": "null"},
{"$ref": "#/definitions/omniguide_metadata"}
]
}
}
},
"undelivered_messages": {"type": "boolean"}
},
"definitions": {
"attachment_single_choice": {
"type": "object",
"properties": {
"type": {"const": "single_choice"},
"image_url": {"type": "string"},
"options": {
"type": "array",
"items": {
"type": "object",
"properties": {
"text": {"type": "string"},
"value": {"type": "string"}
}
}
}
},
"required": ["type", "options"]
},
"attachment_single_choice_response": {
"type": "object",
"properties": {
"type": {"const": "single_choice_response"},
"selected_option": {"type": "string"}
}
},
"omniguide_metadata": {
"type": "object",
"properties": {
"type": {"enum": ["prompt", "suggestion"]}
}
}
}
}
}
{
"event_type": "engagement.chat.system_message",
"event_id": "e8bacbef-fee6-4bb7-8c02-b7b1871b98d9",
"dispatched_at": "2017-01-01T00:00:00.0Z",
"message": {
"timestamp": "2017-01-01T00:00:00.0Z",
"id": "388c4a1f-3e08-4cf6-b8ae-d290c07dc61f",
"engagement_id": "c71379b7-4e32-4dd4-a549-04f90f959dd5",
"sub_engagement_id": "fc3aa55f-e6ad-4f4f-9b6b-28541d316a4c",
"content": "AI suggestion",
"status": "sent",
"sender": {
"type": "omniguide"
},
"target": "operator",
"attachment": null,
"metadata": {
"type": "suggestion"
}
},
"undelivered_messages": false
}

TypingIndicatorEvent

Fired when engagement participant Typing Indicator is updated.

  • The typing field specifies whether participant is currently typing or not.

  • The clock is a value that monotonously increases with each typing indicator

    update. Can be used to discard old webhooks that came out of order due to

    network conditions.

{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Description of operator and visitor typing indicator event",
"type": "object",
"properties": {
"event_type": {
"oneOf": [
{"const": "engagement.chat.typing_indicator.operator"},
{"const": "engagement.chat.typing_indicator.visitor"},
]
},
"event_id": {"type": "string"},
"dispatched_at": {"type": "string", "format": "date-time"},
"typing_indicator": {
"type": "object",
"properties": {
"engagement_id": {"type": "string"},
"sub_engagement_id": {"type": "string"},
"sender": {
"type": "object",
"properties": {
"id": {"type": "string"}
}
},
"typing": {"type": "boolean"},
"clock": {"type": "integer"}
}
}
}
}
{
"event_type": "engagement.chat.typing_indicator.visitor",
"event_id": "e8bacbef-fee6-4bb7-8c02-b7b1871b98d9",
"dispatched_at": "2017-01-01T00:00:00.0Z",
"typing_indicator": {
"engagement_id": "3fc86c57-2cdf-4cc0-b04e-319128a6989d",
"sub_engagement_id": "fc3aa55f-e6ad-4f4f-9b6b-28541d316a4c",
"sender" : {
"id": "02adab9c-39e2-447e-afc3-13bbce5b445c"
},
"typing": true,
"clock": 1234
}
}

MediaUpgradeRequestCreatedEvent

Fired when a Media Upgrade Request is created by one engagement participant.

  • The audio is two_way, if audio is used, or null, if audio is not

    requested.

  • The video is one of Media directions or

    null if video is not requested.

  • The target is the receiver of the upgrade request. Can be either visitor

    or operator. More targets can be added in future.

{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Description of engagement.media_upgrade_request event",
"type": "object",
"properties": {
"event_type": {"const": "engagement.media_upgrade_request"},
"event_id": {"type": "string"},
"dispatched_at": {"type": "string", "format": "date-time"},
"media_upgrade_request": {
"type": "object",
"properties": {
"id": {"type": "string"},
"audio": {
"oneOf": [{"type": "null"}, {"const": "two_way"}]
},
"video": {
"oneOf": [{"type": "null"}, {"enum": ["one_way", "two_way"]}]
},
"target": {"enum": ["visitor", "operator"]},
"engagement_id": {"type": "string"},
"sub_engagement_id": {"type": "string"}
}
}
}
}

EngagementEvent

Fired when the Event has been performed by the visitor.

Field

Description

content

The recorded Event name.

sender

The visitor of the Engagement.

timestamp

Server time at the moment when the message is generated.

{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Description of engagement.event",
"type": "object",
"properties": {
"event_type": {"const": "engagement.event"},
"event_id": {"type": "string", "format": "uuid"},
"dispatched_at": {"type": "string", "format": "date-time"},
"message": {
"type": "object",
"properties": {
"timestamp": {"type": "string", "format": "date-time"},
"id": {"type": "string", "format": "uuid"},
"engagement_id": {"type": "string", "format": "uuid"},
"sub_engagement": {
"type": "object",
"properties": {
"id": {"type": "string", "format": "integer"},
"operator_id": {"type": "string", "format": "uuid"},
"site_id": {"type": "string", "format": "uuid"}
}
},
"sender": {
"type": "object",
"properties": {
"type": {"enum": ["visitor"]},
"id": {"type": "string", "format": "uuid"}
}
},
"content": {"type": "string"}
}
}
}
}
{
"event_type": "engagement.event",
"event_id": "b2ce3750-de68-4d05-85fa-40a3ccc249bb",
"dispatched_at": "2017-01-01T00:00:00.0Z",
"message": {
"timestamp": "2017-01-01T00:00:00.0Z",
"id": "03aeeac7-71f0-449b-b94f-244926696341",
"engagement_id": "3fc86c57-2cdf-4cc0-b04e-319128a6989d",
"sub_engagement": {
"id": "1",
"operator_id": "48eaae29-9ae4-4351-9567-42595e11f764",
"site_id": "f8603421-6e3e-44d4-9736-c12f13c4266f"
},
"sender": {
"type": "visitor",
"id": "561725f6-c2f8-4fc5-83e8-037085c4060e"
},
"content": "Visitor navigated to insurance page"
}
}

VisitorAuthenticationSuccessEvent

Fired when a Visitor Authentication Request is successful. This event includes the visitor's authenticated attributes fetched from the authentication provider.

{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Description of visitor.authentication.success event",
"type": "object",
"properties": {
"event_type": {"const": "visitor.authentication.success"},
"event_id": {"type": "string"},
"dispatched_at": {"type": "string", "format": "date-time"},
"authentication_response": {
"type": "object",
"properties": {
"authentication_request_id": {"type": "string"},
"visitor_id": {"type": "string"},
"access_token": {"type": "string"},
"name": {
"oneOf": [{"type": "null"}, {"type": "string"}]
},
"preferred_name": {
"oneOf": [{"type": "null"}, {"type": "string"}]
},
"email": {
"oneOf": [{"type": "null"}, {"type": "string"}]
},
"id_token": {
"oneOf": [{"type": "null"}, {"type": "string"}]
},
"issuer": {
"oneOf": [{"type": "null"}, {"type": "string"}]
},
"subject": {
"oneOf": [{"type": "null"}, {"type": "string"}]
}
}
}
}
}
{
"event_type": "visitor.authentication.success",
"event_id": "e8bacbef-fee6-4bb7-8c02-b7b1871b98d9",
"dispatched_at": "2017-01-01T00:00:00.0Z",
"authentication_response": {
"name": "Harry Brown",
"email": "harry_brown@cortex.xyz",
"preferred_name": "Harry",
"id_token": "eyJraWQiOiJqTUVZVXhCZ05jZ0lmZnoxUVVneVdRUU1DeWlMNTktT3ps",
"access_token": "eyJraWQiOiJHakNJNHlFRWZkOUFDZ3BELTZfM2pWbEU0cndsQjBLNURO",
"issuer": "https://example.com.com",
"subject": "00123xx6ba8i5aaSOCBx",
"authentication_request_id": "3b88576f-1fb2-4aa5-9188-2931df5a0783"
}
}

VisitorAuthenticationFailureEvent

Fired when a Visitor Authentication Request has failed. It contains the failure reason.

{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Description of visitor.authentication.failure event",
"type": "object",
"properties": {
"event_type": {"const": "visitor.authentication.failure"},
"event_id": {"type": "string"},
"dispatched_at": {"type": "string", "format": "date-time"},
"authentication_response": {
"type": "object",
"properties": {
"fail_reason": {"type": "string"},
"authentication_request_id": {"type": "string"}
}
}
}
}
{
"event_type": "visitor.authentication.failure",
"event_id": "e8bacbef-fee6-4bb7-8c02-b7b1871b98d9",
"dispatched_at": "2017-01-01T00:00:00.0Z",
"authentication_response": {
"fail_reason": "DecodeTokenError",
"authentication_request_id": "3b88576f-1fb2-4aa5-9188-2931df5a0783"
}
}

SipDomainDeletedEvent

Fired when a SIP domain is deleted.

{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Description of sip_domain.delete event",
"type": "object",
"properties": {
"event_type": {"const": "sip_domain.delete"},
"event_id": {"type": "string"},
"dispatched_at": {"type": "string", "format": "date-time"},
"sip_domain": {
"type": "object",
"properties": {
"id": {"type": "string"}
}
}
}
}
{
"event_type": "sip_domain.delete",
"event_id": "e8bacbef-fee6-4bb7-8c02-b7b1871b98d9",
"dispatched_at": "2017-01-01T00:00:00.0Z",
"sip_domain": {
"id": "6f8228e4-6f5d-4081-8b16-21dd2781fdb4"
}
}

FileSecurityScanResultEvent

Fired when the file which has been uploaded to the engagement has been scanned.

After the scanning has been completed and the result is clean, the file can be sent with a message. If the security scan is in progress or the scan result is infected, the file cannot be included in a message.

Field

Description

file_id

ID of the file.

result

Either clean or infected.

{
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "Description of engagement.files.security_scan_result event",
"type": "object",
"properties": {
"event_type": {"const": "engagement.files.security_scan_result"},
"event_id": {"type": "string"},
"dispatched_at": {"type": "string", "format": "date-time"},
"security_scan_result": {
"type": "object",
"properties": {
"file_id": {"type": "string", "format": "uuid"},
"result": {
"type": "string",
"enum": ["clean", "infected"]
}
}
}
}
}
{
"event_type": "engagement.files.security_scan_result",
"event_id": "f53b6627-f982-4e92-a035-4a32ae76e6cf",
"dispatched_at": "2017-01-01T00:00:00.0Z",
"security_scan_result": {
"file_id": "987f5187-94c7-47a6-9b52-bba4e63d2558",
"result": "clean"
}
}