# Webhooks

## The Event Categories

* [Sessions](#sessions)
* [Session Activities](#session-activities)
* [E-mails](#e-mails)
* [Others](#others)

## Sessions

The diagram below describes all the events in the life cycle of a session from inception to termination. Session redirection to another operator may not occur and is shown for completeness only.

<figure><img src="https://2503272169-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk7qHNgmhjqfQcnjtzG64%2Fuploads%2F39oinyQIXn9rYVxKs98Y%2Fsession_lifecycle.png?alt=media&#x26;token=2dbcc586-abf1-4485-9d7a-48b45f00306b" alt=""><figcaption></figcaption></figure>

| Event                       | Time                               |
| --------------------------- | ---------------------------------- |
| SessionCreated              | "2024-05-02T08:58:58:888364+02:00" |
| SessionStarted              | "2024-05-02T08:58:58:888364+02:00" |
| SessionOperatorJoined       | "2024-05-02T08:59:18:467643+02:00" |
| SessionForwarded (optional) | "2024-05-02T09:02:26:568252+02:00" |
| SessionEnded                | "2024-05-02T09:13:07:965191+02:00" |
| SessionOperatorLeft         | "2024-05-02T09:13:07:965191+02:00" |
| SessionOperatorConcluded    | "2024-05-02T09:15:50:838056+02:00" |

### SessionCreated

A new session has been created in the tenant and the event is logged before the operator or chatbot joins the session.

| Parameter | Value  | Example                             |
| --------- | ------ | ----------------------------------- |
| id        | number | 7293902                             |
| tenantId  | number | 62                                  |
| channel   | string | [session channel](#session-channel) |
| source    | string | [session source](#session-source)   |

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionCreated",
  "data": {
    "id": 7371450,
    "tenantId": 62,
    "channel": "Phone",
    "source": "OutgoingCall"
  }
}
```

</details>

### SessionStarted

The session has started (e.g. a client has entered the queue and an operator is being searched for). This applies to all [channels](#session-channel) in mluvii. A chatbot can also communicate with the client in a session.

<table><thead><tr><th width="206">Parameter</th><th width="248">Value</th><th>Example</th></tr></thead><tbody><tr><td>id</td><td>number</td><td>7293902</td></tr><tr><td>tenantId</td><td>number</td><td>62</td></tr><tr><td>channel</td><td>string</td><td><a href="#session-channel">session channel</a></td></tr><tr><td>source</td><td>string</td><td><a href="#session-source">session source</a></td></tr><tr><td>started</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionStarted",
  "data": {
    "id": 7371450,
    "tenantId": 62,
    "channel": "Phone",
    "source": "OutgoingCall",
    "started": "2024-05-02T16:05:24.454661+02:00"
  }
}
```

</details>

### SessionOperatorJoined

It happens at the moment the operator joins the session. For example, right at the beginning (after [SessionCreated](#sessioncreated)). It is valid that for each operator in the session, a custom event is logged.

<table><thead><tr><th width="206">Parameter</th><th width="248">Value</th><th>Example</th></tr></thead><tbody><tr><td>id</td><td>number</td><td>7293902</td></tr><tr><td>tenantId</td><td>number</td><td>62</td></tr><tr><td>userId</td><td>number</td><td>2710</td></tr><tr><td>channel</td><td>string</td><td><a href="#session-channel">session channel</a></td></tr><tr><td>source</td><td>string</td><td><a href="#session-source">session source</a></td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionOperatorJoined",
  "data": {
    "id": 7371450,
    "tenantId": 62,
    "userId": 4,
    "channel": "Phone",
    "source": "OutgoingCall",
    "time": "2024-05-02T16:05:24.454661+02:00"
  }
}
```

</details>

### SessionForwarded

The session was redirected. In this case, there are no details available as in the case of [SessionActivitySessionForwarded](#sessionactivitysessionforwarded).

<table><thead><tr><th width="206">Parameter</th><th width="248">Value</th><th>Example</th></tr></thead><tbody><tr><td>id</td><td>number</td><td>7293902</td></tr><tr><td>tenantId</td><td>number</td><td>62</td></tr><tr><td>channel</td><td>string</td><td><a href="#session-channel">session channel</a></td></tr><tr><td>source</td><td>string</td><td><a href="#session-source">session source</a></td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>userId</td><td>number</td><td>2710</td></tr><tr><td>operatorGroupId</td><td>number</td><td>7299</td></tr><tr><td>chatbotId</td><td>number</td><td>7352</td></tr></tbody></table>

{% hint style="info" %}
*The response may include "userId", "operatorGroupId", or "chatbotId", depending on the target the operator is forwarding to.*
{% endhint %}

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionForwarded",
  "data": {
    "id": 7373420,
    "tenantId": 62,
    "channel": "Chat",
    "source": "Default",
    "time": "2024-05-03T09:41:31.257306+02:00",
    "userId": null,
    "operatorGroupId": 7299,
    "chatbotId": null
  }
}
```

</details>

### SessionEnded

Triggered when a session has ended (the operator or the client has finished the session).

<table><thead><tr><th width="196.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>id</td><td>number</td><td>7293902</td></tr><tr><td>tenantId</td><td>number</td><td>62</td></tr><tr><td>channel</td><td>string</td><td><a href="#session-channel">Session channel</a></td></tr><tr><td>source</td><td>string</td><td><a href="#session-source">Session source</a></td></tr><tr><td>started</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>ended</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionEnded",
  "data": {
    "id": 7363963,
    "tenantId": 62,
    "channel": "Chat",
    "source": "Default",
    "started": "2024-04-30T13:32:31.105138+02:00",
    "ended": "2024-05-02T15:34:12.871976+02:00"
  }
}
```

</details>

### SessionOperatorLeft

Once the operator ends the session (clicks the "End" button). It then enters the ACW state.

<table><thead><tr><th width="196.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>id</td><td>number</td><td>7293902</td></tr><tr><td>tenantId</td><td>number</td><td>62</td></tr><tr><td>userId</td><td>number</td><td>2710</td></tr><tr><td>channel</td><td>string</td><td><a href="#session-channel">Session channel</a></td></tr><tr><td>source</td><td>string</td><td><a href="#session-source">Session source</a></td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr></tbody></table>

{% hint style="info" %}
*If multiple operators are active in the session, only one of them is logged into SessionOperatorLeft. For the others, the* [*SessionOperatorConcluded*](#sessionoperatorconcluded-1) *event is logged.*
{% endhint %}

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionOperatorLeft",
  "data": {
    "id": 7371193,
    "tenantId": 62,
    "userId": 4301,
    "channel": "AV",
    "source": "Invitation",
    "time": "2024-05-02T15:32:52.539588+02:00"
  }
}
```

</details>

### SessionOperatorConcluded

It happens when ACW is automatically/manually terminated. Then also when the session is redirected from the operator to the next destination (operator/group/chatbot/external phone number).

<table><thead><tr><th width="196.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>id</td><td>number</td><td>7293902</td></tr><tr><td>tenantId</td><td>number</td><td>62</td></tr><tr><td>userId</td><td>number</td><td>2710</td></tr><tr><td>channel</td><td>string</td><td><a href="#session-channel">Session channel</a></td></tr><tr><td>source</td><td>string</td><td><a href="#session-source">Session source</a></td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionOperatorConcluded",
  "data": {
    "id": 7429963,
    "tenantId": 62,
    "userId": 2710,
    "channel": "Chat",
    "source": "Default",
    "time": "2024-05-20T14:46:29.969234+02:00"
  }
}
```

</details>

## Session Activities

### SessionActivityAutoActivity

The event is logged with each automatic message in the session. For example, it could be an automated message sent due to client inactivity or an operator being busy handling multiple interactions at once.

<table><thead><tr><th width="196.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>activityId</td><td>number</td><td>50878507</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>AutoActivity</td></tr><tr><td>text</td><td>string</td><td>"Jsme stále ve spojení?"</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityAutoActivity",
  "data": {
    "sessionId": 7380342,
    "activityId": 50878507,
    "time": "2024-05-06T08:31:13.722852+02:00",
    "type": "AutoActivity",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": null,
    "client": null,
    "text": "<p>zpráva</p>",
    "previewUrl": null,
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": null,
    "toOperatorFullName": null,
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": null,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": null,
    "terminationReason": null
  }
}
```

</details>

### SessionActivityAvRequest

The event captures the moment when the operator upgrades the webchat to an Audio/Video call. The operator clicks on the "Call" tab in the interface, enters the A/V room, and invites the client.

<table><thead><tr><th width="196.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>userId</td><td>number</td><td>4555</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityAvRequest",
  "data": {
    "sessionId": 7375793,
    "operatorId": 2710,
    "time": "2024-05-03T13:54:49.450758+02:00"
  }
}
```

</details>

### SessionActivityAvTerminated

This happens when the operator terminates the A/V call and continues text-only communication. The operator clicks the **"Disconnect Client" button** or the cross button in the corner of the A/V blade.

<table><thead><tr><th width="196.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>userId</td><td>number</td><td>4555</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityAvTerminated",
  "data": {
    "sessionId": 7375793,
    "operatorId": 2710,
    "time": "2024-05-03T13:57:03.140972+02:00"
  }
}
```

</details>

### SessionActivityCallScript

It happens every time each contact is called within the campaign where CallScript is set up. The CallScript does not need to be acknowledged by the operator.

<table><thead><tr><th width="196.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>CallScript</td></tr><tr><td>callscript</td><td>array</td><td>Form Structure (bellow)</td></tr></tbody></table>

<details>

<summary>Form Structure</summary>

\[

{"inputType": "RichText",

"label": "\<p>byt\</p>", "ordinal": 1

},

{"inputType": "Text",

"label": "dispozice",

"key": "Dispozice",

"required": true,

"ordinal": 2

},

{"InputType": "Radio",

"label": "centrum", "key": "somethingelse",

"required": true, "ordinal": 3,

"choiceOptions":\[

{"value": "ano",

"label": "ano"},

{"value": "ne",

"label": "ne"}]

}

</details>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityCallScript",
  "data": {
    "sessionId": 7383104,
    "activityId": 50894607,
    "time": "2024-05-06T13:46:07.605708+02:00",
    "type": "CallScript",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": [
      {
        "inputType": "RichText",
        "label": "<p>Dobrý den, pane XXX</p>",
        "ordinal": 1
      },
      {
        "inputType": "Text",
        "label": "Dispozice",
        "key": "dispozice",
        "required": true,
        "ordinal": 2
      },
      {
        "inputType": "Radio",
        "label": "zvíře",
        "key": "somethingelse",
        "required": true,
        "ordinal": 3,
        "choiceOptions": [
          {
            "value": "kočka",
            "label": "kočka"
          }
        ]
      },
      {
        "inputType": "Radio",
        "label": "dfdfdfdfsdf",
        "key": "ujasnění",
        "required": true,
        "ordinal": 4,
        "choiceOptions": [
          {
            "value": "ano",
            "label": "ano"
          }
        ]
      }
    ],
    "client": null,
    "text": null,
    "previewUrl": null,
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": null,
    "toOperatorFullName": null,
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": null,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": "afebe607-a007-489d-ba03-dd9deaa17f8d",
    "terminationReason": null
  }
}
```

</details>

### SessionActivityCallScriptSubmission

In the session, the CallScript is confirmed by the operator. CallScript is used only for telephone campaigns.

<table><thead><tr><th width="196.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>CallScriptSubmission</td></tr><tr><td>client</td><td>string</td><td>Guest</td></tr></tbody></table>

{% hint style="info" %}
*The webhook is delivered as soon as the ACW session is over.*
{% endhint %}

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityCallScriptSubmission",
  "data": {
    "sessionId": 7383014,
    "activityId": 50894089,
    "time": "2024-05-06T13:37:57.649363+02:00",
    "type": "CallScriptSubmission",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": null,
    "client": "Guest",
    "text": null,
    "previewUrl": null,
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": null,
    "toOperatorFullName": null,
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": null,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": null,
    "terminationReason": null
  }
}
```

</details>

### SessionActivityCobrowsingStarted

In the session, cobrowsing was initiated and the client agreed to the request from the operator.

<table><thead><tr><th width="196.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>activityId</td><td>number</td><td>49717950</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>SessionActivityCobrowsingStarted</td></tr><tr><td>client</td><td>string</td><td>Guest</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityCobrowsingStarted",
  "data": {
    "sessionId": 7383263,
    "activityId": 50895810,
    "time": "2024-05-06T14:10:19.928721+02:00",
    "type": "CobrowsingStarted",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": null,
    "client": "Guest",
    "text": null,
    "previewUrl": null,
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": null,
    "toOperatorFullName": null,
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": null,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": null,
    "terminationReason": null
  }
}
```

</details>

### SessionActivityExternalMessage

This can be an introductory message set at the Facebook page level (outside the app), or messages sent to the client outside the mluvii app (via Facebook Messenger).

<table><thead><tr><th width="196.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>activityId</td><td>number</td><td>49717950</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>ExteernalMessage</td></tr><tr><td>text</td><td>string</td><td>Message sent from the Facebook</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityExternalMessage",
  "data": {
    "sessionId": 7369378,
    "activityId": 50896981,
    "time": "2024-05-06T14:33:06.262+02:00",
    "type": "ExternalMessage",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": null,
    "client": null,
    "text": "Dobrý den",
    "previewUrl": null,
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": null,
    "toOperatorFullName": null,
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": null,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": null,
    "terminationReason": null
  }
}
```

</details>

### SessionActivityHeroCard

A HeroCard was sent during the session.

<table><thead><tr><th width="196.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>activityId</td><td>number</td><td>49717950</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>HeroCard</td></tr><tr><td>heroCard</td><td>array</td><td>HeroCard structure</td></tr><tr><td>client</td><td>string</td><td>User</td></tr></tbody></table>

<details>

<summary>HeroCard Structure</summary>

\[

{"inputType": "RichText",

"label": "\<p>byt\</p>", "ordinal": 1

},

{"inputType": "Text",

"label": "dispozice",

"key": "Dispozice",

"required": true,

"ordinal": 2

},

{"InputType": "Radio",

"label": "centrum", "key": "somethingelse",

"required": true, "ordinal": 3,

"choiceOptions":\[

{"value": "ano",

"label": "ano"},

{"value": "ne",

"label": "ne"}]

}

</details>

{% hint style="info" %}
*The "client" parameter can take values (User, Chatbot). Depending on this, the value of the "userId" or "chatbotId" parameter is also filled in.*
{% endhint %}

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityHeroCard",
  "data": {
    "sessionId": 7383497,
    "activityId": 50897242,
    "time": "2024-05-06T14:37:20.236594+02:00",
    "type": "HeroCard",
    "heroCard": [
      {
        "inputType": "RichText",
        "label": "<p>Prosím, zadejte své kontaktní údaje.</p>",
        "ordinal": 1
      },
      {
        "inputType": "Text",
        "label": "Jméno",
        "key": "oo1_guest_ident",
        "required": true,
        "ordinal": 2
      },
      {
        "inputType": "Text",
        "label": "E-mail",
        "key": "oo1_guest_email",
        "required": true,
        "ordinal": 3
      },
      {
        "inputType": "Text",
        "label": "Telefon",
        "key": "oo1_guest_phone",
        "required": false,
        "ordinal": 4
      },
      {
        "inputType": "Confirmation",
        "label": "Confirm label",
        "ordinal": 5
      }
    ],
    "heroCardParams": null,
    "callScript": null,
    "client": "Chatbot",
    "text": null,
    "previewUrl": null,
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": null,
    "toOperatorFullName": null,
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": null,
    "chatbotId": 329,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": "e5e7d280-9d29-4668-ae92-2dd27a8902cf",
    "terminationReason": null
  }
}
```

</details>

### SessionActivityHeroCardSubmission

It is logged when the HeroCard is confirmed/canceled (submitted/canceled).

<table><thead><tr><th width="196.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>originalFormID</td><td>number</td><td>3371</td></tr><tr><td>result</td><td><a href="#herocardsubmissionresult">HeroCardSubmissionResult</a></td><td>submitted</td></tr><tr><td>submittedByClient</td><td>bool</td><td>true</td></tr><tr><td>params</td><td>string</td><td>see the example below</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr></tbody></table>

{% hint style="info" %}
*The OriginalFormID parameter is the existing HeroCard ID in mluvii.*
{% endhint %}

{% hint style="info" %}
*The parameters used in the given HeroCard are stored in params together with the entered values (e.g. "oo1\_guest\_email", "oo1\_guest\_ident", "oo1\_guest\_phone").*
{% endhint %}

{% hint style="success" %}
*There are also cases where the HeroCard is confirmed by the operator instead of the client. In this case, the value false is stored in the "submittedByClient" parameter.*
{% endhint %}

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityHeroCardSubmission",
  "data": {
    "sessionId": 7383497,
    "result": "Submitted",
    "originalFormID": 2273,
    "submittedByClient": false,
    "params": {
      "barva": "Červená",
      "model": "Focus",
      "palivo": "Benzín",
      "oo1_guest_ident": "Zbyněk Hostaš",
      "značka": "Volkswagen",
      "číslo ŘP": "147852369"
    },
    "time": "2024-05-06T14:44:07.799984+02:00"
  }
}
```

</details>

### SessionActivityChatToMail

It occurs when the client enters an e-mail in the [Feedback Form ](https://docs.mluvii.com/en/for-administrators/tenant-management/settings/forms/forms)and sends a transcript, or the operator sends it.

<table><thead><tr><th width="196.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>activityId</td><td>number</td><td>50108494</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>ChatToMail</td></tr><tr><td>client</td><td>string</td><td>Guest</td></tr></tbody></table>

{% hint style="info" %}
*The value Guest is stored in the "client" parameter if the client sends the session transcript itself. Or the value User and the parameter "userID" is used, which is filled only if the initiator of the action is an operator.*
{% endhint %}

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityChatToMail",
  "data": {
    "sessionId": 7383497,
    "activityId": 50897938,
    "time": "2024-05-06T14:49:23.808642+02:00",
    "type": "ChatToMail",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": null,
    "client": "User",
    "text": null,
    "previewUrl": null,
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": null,
    "toOperatorFullName": null,
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": 2710,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": null,
    "terminationReason": null
  }
}
```

</details>

### SessionActivityLastFarewellMessage

It is logged if the session is automatically terminated after 24 hours of queuing. This is particularly relevant for WhatsApp. You can also track this event for Facebook Messenger sessions.

<table><thead><tr><th width="196.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>activityId</td><td>number</td><td>50108494</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>LastFarewellMessage</td></tr><tr><td>text</td><td>string</td><td>We apologize, but your request...</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityLastFarewellMessage",
  "data": {
    "sessionId": 7404414,
    "activityId": 51135367,
    "time": "2024-05-15T15:32:58.045333+02:00",
    "type": "LastFarewellMessage",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": null,
    "client": null,
    "text": "We’re sorry, but your request was automatically closed due to exceeding the 24-hour response time set by WhatsApp and Facebook. If your question is still up to date, please contact us again. Thank you.",
    "previewUrl": null,
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": null,
    "toOperatorFullName": null,
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": null,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": null,
    "terminationReason": null
  }
}
```

</details>

### SessionActivityPreviewUrl

A message containing a URL link appears in the session.

<table><thead><tr><th width="196.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>activityId</td><td>number</td><td>50108494</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>PreviewUrl</td></tr><tr><td>client</td><td>string</td><td>User</td></tr><tr><td>previewUrl</td><td>                          -</td><td>                                -                                 </td></tr><tr><td>.../title</td><td>string</td><td>Google</td></tr><tr><td>.../imageUrl</td><td>string</td><td>https://www.seznam.cz/media/...</td></tr><tr><td>.../contantType</td><td>number</td><td>1</td></tr><tr><td>.../originalUrl</td><td>string</td><td><a href="https://www.seznam.cz/">https://www.seznam.cz/</a></td></tr><tr><td>.../originalActivityId</td><td>number</td><td>114253</td></tr><tr><td>userId</td><td>number</td><td>2070</td></tr></tbody></table>

{% hint style="info" %}
*Depending on which party sent the link, the value "guest", "user" or "chatbot" is stored in the "Client" parameter, which is rendered (in both cases only the "Client" (guest, user) parameters change). If the URL is sent by an operator, the userId is also filled in.*
{% endhint %}

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityPreviewUrl",
  "data": {
    "sessionId": 7383741,
    "activityId": 50899088,
    "time": "2024-05-06T15:10:16.12969+02:00",
    "type": "PreviewUrl",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": null,
    "client": "Guest",
    "text": null,
    "previewUrl": {
      "title": "Seznam – najdu tam, co neznám",
      "imageUrl": "http://www.seznam.cz/media/img/logo-share-square_v2.png",
      "contentType": 1,
      "originalUrl": "http://www.seznam.cz/",
      "originalActivityId": 50899086
    },
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": null,
    "toOperatorFullName": null,
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": null,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": null,
    "terminationReason": null
  }
}
```

</details>

### SessionActivityOnHold

During a call, the operator puts the call on hold (the "Hold call" button).

<table><thead><tr><th width="196.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>activityId</td><td>number</td><td>50108494</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>OnHold</td></tr><tr><td>client</td><td>string</td><td>User</td></tr><tr><td>userId</td><td>number</td><td>2710</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityOnHold",
  "data": {
    "sessionId": 7383730,
    "activityId": 50898864,
    "time": "2024-05-06T15:05:29.719899+02:00",
    "type": "OnHold",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": null,
    "client": "User",
    "text": null,
    "previewUrl": null,
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": null,
    "toOperatorFullName": null,
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": 2710,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": null,
    "terminationReason": null
  }
}
```

</details>

### SessionActivityOperatorInviteCanceled

The operator invited another operator to the session and canceled the invitation before the operator joined.

<table><thead><tr><th width="196.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>activityId</td><td>number</td><td>50108494</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>OperatorInviteCanceled</td></tr><tr><td>client</td><td>string</td><td>User</td></tr><tr><td>userId</td><td>number</td><td>2710</td></tr></tbody></table>

{% hint style="info" %}
*UserId indicates the operator who canceled the invitation.*
{% endhint %}

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityOperatorInviteCanceled",
  "data": {
    "sessionId": 7383741,
    "activityId": 50899127,
    "time": "2024-05-06T15:11:36.541724+02:00",
    "type": "OperatorInviteCanceled",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": null,
    "client": "User",
    "text": null,
    "previewUrl": null,
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": null,
    "toOperatorFullName": null,
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": 2710,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": null,
    "terminationReason": null
  }
}
```

</details>

### SessionActivityOperatorInvited

The operator invited another operator into the session. UserId indicates the operator who sent the invitation.

<table><thead><tr><th width="205.33333333333331">Parameter</th><th width="254">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>activityId</td><td>number</td><td>50108494</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>OperatorInvited</td></tr><tr><td>client</td><td>string</td><td>User</td></tr><tr><td>toOperatorUserId</td><td>number</td><td>4301</td></tr><tr><td>toOperatorFullName</td><td>string</td><td>Jan Novák</td></tr><tr><td>note</td><td>string</td><td>Please join us.</td></tr><tr><td>userId</td><td>number</td><td>2710</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityOperatorInvited",
  "data": {
    "sessionId": 7383741,
    "activityId": 50899168,
    "time": "2024-05-06T15:12:44.604+02:00",
    "type": "OperatorInvited",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": null,
    "client": "User",
    "text": null,
    "previewUrl": null,
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": 4254,
    "toOperatorFullName": "Štěpán Bazala",
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": "",
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": 2710,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": null,
    "terminationReason": null
  }
}
```

</details>

### SessionActivityOperatorInviteRejected

The operator invited another operator to the session and he declined the invitation. UserId indicates the operator who declined the invitation.

<table><thead><tr><th width="205.33333333333331">Parameter</th><th width="246">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>activityId</td><td>number</td><td>50108494</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>OperatorInviteRejected</td></tr><tr><td>client</td><td>string</td><td>User</td></tr><tr><td>userId</td><td>number</td><td>2710</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityOperatorInviteRejected",
  "data": {
    "sessionId": 7383936,
    "activityId": 50900431,
    "time": "2024-05-06T15:45:46.295607+02:00",
    "type": "OperatorInviteRejected",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": null,
    "client": "User",
    "text": null,
    "previewUrl": null,
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": null,
    "toOperatorFullName": null,
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": 4254,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": null,
    "terminationReason": null
  }
}
```

</details>

### SessionActivityResumeGuest

The event is closely related to another event ([SessionActivityOnHold](#sessionactivityonhold)) that precedes this one. This time the operator clicks on the "Continue call" button.

<table><thead><tr><th width="205.33333333333331">Parameter</th><th width="249">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>activityId</td><td>number</td><td>50108494</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>ResumeGuest</td></tr><tr><td>client</td><td>string</td><td>User</td></tr><tr><td>userId</td><td>number</td><td>2710</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityResumeGuest",
  "data": {
    "sessionId": 7383786,
    "activityId": 50899230,
    "time": "2024-05-06T15:14:50.080729+02:00",
    "type": "ResumeGuest",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": null,
    "client": "User",
    "text": null,
    "previewUrl": null,
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": null,
    "toOperatorFullName": null,
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": 2710,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": null,
    "terminationReason": null
  }
}
```

</details>

### SessionActivitySessionEnded

It's sent whenever a session ends no matter how it happened or who did it.

<table><thead><tr><th width="205.33333333333331">Parameter</th><th width="249">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>activityId</td><td>number</td><td>50108494</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>SessionEnded</td></tr><tr><td>client</td><td>string</td><td>Guest</td></tr><tr><td>userId</td><td>number</td><td>2710</td></tr><tr><td>terminationReason</td><td>string</td><td><a href="#termination-reason">Termination Reason</a></td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivitySessionEnded",
  "data": {
    "sessionId": 7383798,
    "activityId": 50899289,
    "time": "2024-05-06T15:16:43.605072+02:00",
    "type": "SessionEnded",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": null,
    "client": "Guest",
    "text": null,
    "previewUrl": null,
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": null,
    "toOperatorFullName": null,
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": null,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": null,
    "terminationReason": "GuestLeft"
  }
}
```

</details>

### SessionActivitySessionForwarded

It happens when forwarding sessions from the operator (userId) or chatbot (chatbotId) side. If the operator (chatbot) is switching to an operator, the "toOperatorUserId" or "toOperatorFullName" parameter is used.

<table><thead><tr><th width="205.33333333333331">Parameter</th><th width="249">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>activityId</td><td>number</td><td>50108494</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>SessionForwarded</td></tr><tr><td>client</td><td>string</td><td>User</td></tr><tr><td>toGroupId</td><td>number</td><td>7229</td></tr><tr><td>toOperatorId</td><td>number</td><td>2710</td></tr></tbody></table>

{% hint style="info" %}
*If the session is switched to an operator group, the "toGroupId" or "toGroupName" parameter is used. Interestingly, the same parameters are also used when forwarding to a chatbot.*
{% endhint %}

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivitySessionForwarded",
  "data": {
    "sessionId": 7383798,
    "activityId": 50899288,
    "time": "2024-05-06T15:16:41.556226+02:00",
    "type": "SessionForwarded",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": null,
    "client": "User",
    "text": null,
    "previewUrl": null,
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": 4,
    "toOperatorFullName": "Ondřej Fogatoš",
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": 2710,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": null,
    "terminationReason": null
  }
}
```

</details>

### SessionActivitySharedFile

Within a session, a file is shared (by the operator or client).

<table><thead><tr><th width="205.33333333333331">Parameter</th><th width="249">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>activityId</td><td>number</td><td>50108494</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>SharedFile</td></tr><tr><td>client</td><td>string</td><td>User</td></tr><tr><td>userId</td><td>number</td><td>2710</td></tr><tr><td>file</td><td>                       -                                          </td><td>                               -</td></tr><tr><td>.../id</td><td>number</td><td>2635914</td></tr><tr><td>.../operatorOwner</td><td>number</td><td>2710</td></tr><tr><td>.../departmentOwner</td><td>number</td><td>62</td></tr><tr><td>.../name</td><td>string</td><td>image</td></tr></tbody></table>

{% hint style="info" %}
*An operator can share its own or shared files. You can tell by the "operatorOwner" and "departmentOwner" parameters. If the operator shares a file from a file from his drive, both of these parameters will be empty.*

*A client can also share a file if prompted to do so by the operator. In this case, the value "Guest" will appear in the "client" parameter.*
{% endhint %}

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivitySharedFile",
  "data": {
    "sessionId": 7418778,
    "activityId": 51164839,
    "time": "2024-05-16T14:21:41.771847+02:00",
    "type": "SharedFile",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": null,
    "client": "User",
    "text": null,
    "previewUrl": null,
    "file": {
      "id": 2572911,
      "operatorOwner": 2710,
      "departmentOwner": null,
      "name": "png-clipart-alarm-clock-nightstand-graphy-clock-digital-clock-time.png",
      "downloadUrl": null,
      "isUploading": false,
      "isDeleted": false
    },
    "associatedSharedFileUrl": null,
    "toOperatorUserId": null,
    "toOperatorFullName": null,
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": 2710,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": null,
    "terminationReason": null
  }
}
```

</details>

### SessionActivitySharedScreen

This is screen sharing either by the client or by the operator.

<table><thead><tr><th width="205.33333333333331">Parameter</th><th width="249">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>activityId</td><td>number</td><td>50108494</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>SharedScreen</td></tr><tr><td>client</td><td>string</td><td>User</td></tr><tr><td>userId</td><td>number</td><td>2710</td></tr></tbody></table>

{% hint style="info" %}
*The "client" parameter takes the values Guest or User. If an operator shares the screen, its id is also stored in the userId parameter.*
{% endhint %}

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivitySharedScreen",
  "data": {
    "sessionId": 7383872,
    "activityId": 50900005,
    "time": "2024-05-06T15:35:02.284622+02:00",
    "type": "SharedScreen",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": null,
    "client": "User",
    "text": null,
    "previewUrl": null,
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": null,
    "toOperatorFullName": null,
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": 2710,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": null,
    "terminationReason": null
  }
}
```

</details>

### SessionActivityWelcomeMessage

The Welcome message appeared during the session.

<table><thead><tr><th width="205.33333333333331">Parameter</th><th width="249">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>activityId</td><td>number</td><td>50108494</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>type</td><td>string</td><td>WelcomeMessage</td></tr><tr><td>text</td><td>string</td><td>Good Morning, welcome to our chat...</td></tr><tr><td>userId</td><td>number</td><td>2710</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionActivityWelcomeMessage",
  "data": {
    "sessionId": 7383872,
    "activityId": 50899893,
    "time": "2024-05-06T15:31:14.63027+02:00",
    "type": "WelcomeMessage",
    "heroCard": null,
    "heroCardParams": null,
    "callScript": null,
    "client": null,
    "text": "Dobrý den, jsme rádi, že využíváte chat firmy mluvii. 
             Co vás k nám přivádí? ",
    "previewUrl": null,
    "file": null,
    "associatedSharedFileUrl": null,
    "toOperatorUserId": null,
    "toOperatorFullName": null,
    "toGroupId": null,
    "toGroupName": null,
    "toPhoneNumber": null,
    "note": null,
    "chatbotMessageContent": null,
    "submissionIdentification": null,
    "userId": null,
    "chatbotId": null,
    "chatbotHeroCardSubmissionKey": null,
    "chatbotHeroCardSubmissionValue": null,
    "formFieldSetUUID": null,
    "terminationReason": null
  }
}
```

</details>

### SessionCallParamsUpdated

It is logged every time a session parameter is changed and it does not matter who makes the change (operator, chatbot, or supervisor after the session is over).

<table><thead><tr><th width="205.33333333333331">Parameter</th><th width="249">Value</th><th>Example</th></tr></thead><tbody><tr><td>sessionId</td><td>number</td><td>7293902</td></tr><tr><td>tenantId</td><td>number</td><td>62</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionCallParamsUpdated",
  "data": {
    "id": 7383872,
    "tenantId": 62
  }
}
```

</details>

## E-mails

### EmailThreadCreated

It happens when a new email thread is created. Either the client or the operator can start it.

<table><thead><tr><th width="205.33333333333331">Parameter</th><th width="249">Value</th><th>Example</th></tr></thead><tbody><tr><td>id</td><td>number</td><td>742633</td></tr><tr><td>created</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>tenantId</td><td>number</td><td>62</td></tr></tbody></table>

{% hint style="info" %}
*Tato událost se zaloguje i v případě forwardu e-mailu (přeposlání na jinou e-mailovou adresu) ze strany operátora.*
{% endhint %}

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "EmailThreadCreated",
  "data": {
    "id": 749422,
    "tenantId": 62,
    "created": "2024-05-09T14:40:38+02:00"
  }
}
```

</details>

### EmailThreadOperatorJoined

The webhook is delivered when the operator accepts an email message from the group queue.

<table><thead><tr><th width="205.33333333333331">Parameter</th><th width="249">Value</th><th>Example</th></tr></thead><tbody><tr><td>id</td><td>number</td><td>742633</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>userId</td><td>number</td><td>2710</td></tr><tr><td>tenantId</td><td>number</td><td>62</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "EmailThreadOperatorJoined",
  "data": {
    "id": 749425,
    "tenantId": 62,
    "userId": 2710,
    "time": "2024-05-13T12:03:15.57364+02:00"
  }
}
```

</details>

### EmailThreadOperatorLeft

The webhook is delivered when the operator disconnects from the e-mail thread (the operator replies to the e-mail, returns it to the queue for processing, or ignores it).

<table><thead><tr><th width="205.33333333333331">Parameter</th><th width="249">Value</th><th>Example</th></tr></thead><tbody><tr><td>id</td><td>number</td><td>742633</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>userId</td><td>number</td><td>2710</td></tr><tr><td>tenantId</td><td>number</td><td>62</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "EmailThreadOperatorLeft",
  "data": {
    "id": 749425,
    "tenantId": 62,
    "userId": 2710,
    "time": "2024-05-13T12:04:36.435817+02:00"
  }
}
```

</details>

### EmailThreadForwarded

The webhook is delivered when the email thread is forwarded.

<table><thead><tr><th width="205.33333333333331">Parameter</th><th width="249">Value</th><th>Example</th></tr></thead><tbody><tr><td>id</td><td>number</td><td>742633</td></tr><tr><td>time</td><td>datetime</td><td>yyyy-MM-dd'T'HH:mm:ss,SSSZZZZ</td></tr><tr><td>userId</td><td>number</td><td>2710</td></tr><tr><td>operatorGroupId</td><td>number</td><td>388</td></tr><tr><td>tenantId</td><td>number</td><td>62</td></tr></tbody></table>

{% hint style="info" %}
*Along with this event,* [*EmailThreadOperatorLeft*](#emailthreadoperatorleft) *is also logged (the operator has disconnected at the same time).*
{% endhint %}

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "EmailThreadForwarded",
  "data": {
    "id": 749422,
    "tenantId": 62,
    "time": "2024-05-13T12:23:20.866743+02:00",
    "userId": 4254,
    "operatorGroupId": null
  }
}
```

</details>

### EmailThreadParamsUpdated

The webhook is delivered when a parameter is added to the email thread by the operator or by the Public API.

<table><thead><tr><th width="205.33333333333331">Parameter</th><th width="249">Value</th><th>Example</th></tr></thead><tbody><tr><td>id</td><td>number</td><td>742633</td></tr><tr><td>tenantId</td><td>number</td><td>62</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "EmailThreadParamsUpdated",
  "data": {
    "id": 749422,
    "tenantId": 62
  }
}
```

</details>

## Others

### ApplicationSettingChanged

The webhook is delivered when any change is made to the [tenant settings](https://docs.mluvii.com/en/for-administrators/tenant-management/settings/application).

<table><thead><tr><th width="205.33333333333331">Parameter</th><th width="249">Value</th><th>Example</th></tr></thead><tbody><tr><td>name</td><td>string</td><td><a href="#general-settings">General settings</a></td></tr><tr><td>companyId</td><td>number</td><td>1</td></tr><tr><td>tenantId</td><td>number</td><td>62</td></tr></tbody></table>

{% hint style="info" %}
*For each change made to the* [*tenant settings*](https://docs.mluvii.com/en/for-administrators/tenant-management/settings/application)*, the Public API returns 18 responses.*
{% endhint %}

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "ApplicationSettingChanged",
  "data": {
    "name": "phoneCallNumberBlockMinutes",
    "companyId": 1,
    "departmentId": 62,
    "operatorGroupId": null,
    "userId": null,
    "routingRuleSetId": null
  }
}
```

</details>

### GuestIdentityUpdated

The webhook is delivered as soon as the client information changes.

<table><thead><tr><th width="205.33333333333331">Parameter</th><th width="249">Value</th><th>Example</th></tr></thead><tbody><tr><td>id</td><td>number</td><td>345229</td></tr><tr><td>tenantId</td><td>number</td><td>62</td></tr></tbody></table>

{% hint style="info" %}
*The id above indicates the id of the* [*Contact Directory*](https://docs.mluvii.com/en/for-administrators/tenant-management/contact-directory) *entry.*
{% endhint %}

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "GuestIdentityUpdated",
  "data": {
    "id": 3539865,
    "tenantId": 62
  }
}
```

</details>

### SessionRecordingPostProcessingCompleted

The processing of the Audio/Video recording after the session was completed.

<table><thead><tr><th width="205.33333333333331">Parameter</th><th width="249">Value</th><th>Example</th></tr></thead><tbody><tr><td>id</td><td>number</td><td>345229</td></tr><tr><td>tenantId</td><td>number</td><td>62</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "SessionRecordingPostProcessingCompleted",
  "data": {
    "id": 7404608,
    "tenantId": 62
  }
}
```

</details>

### UserStatusChanged

The webhook is delivered when the operator state changes.

<table><thead><tr><th width="234.33333333333331">Parameter</th><th width="249">Value</th><th>Example</th></tr></thead><tbody><tr><td>userId</td><td>number</td><td>2710</td></tr><tr><td>status</td><td><a href="#operator-status">Operator status</a></td><td>ONLINE</td></tr><tr><td>availabilityStatus</td><td><a href="#operator-availability-status">Operator awailability status</a></td><td>DEFAULT</td></tr><tr><td>availabilityStatusReason</td><td>string</td><td>null</td></tr></tbody></table>

<details>

<summary>JSON Example</summary>

```json
{
  "eventType": "UserStatusChanged",
  "data": {
    "userId": 2710,
    "status": "AWAY",
    "availabilityStatus": "AWAY",
    "availabilityStatusReason": null
  }
}
```

</details>

## Enums

### GetMediaResult

| Value           | Description                     |
| --------------- | ------------------------------- |
| Success         | Successful transfer             |
| NoCameraOnlyMic | Only microfon                   |
| NoDevices       | No audio/video devices          |
| UserDenied      | User denied audio/video devices |

### SessionAVRequestState

| Value         | Description                  |
| ------------- | ---------------------------- |
| Requested     | Requested                    |
| Accepted      | Accepted                     |
| RejectedUser  | Rejected by user             |
| RejectedNoMic | Guest does not have microfon |

### Session source

| Value        | Description                 |
| ------------ | --------------------------- |
| Default      | WebChat                     |
| Callback     | Callback                    |
| Invitation   | Invitation                  |
| IncomingCall | Incoming call               |
| OutgoingCall | Outgoing call               |
| Campaign     | Campaign                    |
| API          | Public API                  |
| Facebook     | Facebook                    |
| WhatsApp     | WhatsApp                    |
| VK           | VKontakte                   |
| Apple        | Apple Messages for Business |

### Session channel

| Value | Description          |
| ----- | -------------------- |
| AV    | Audio video transfer |
| Chat  | Text channel         |
| Phone | Phone call           |

### Operator status

| Value   | Description |
| ------- | ----------- |
| OFFLINE | Offline     |
| ONLINE  | Online      |
| AWAY    | Away        |

### Operator availability status

| Value    | Description      |
| -------- | ---------------- |
| DEFAULT  | Online           |
| AWAY     | Away             |
| ON\_CALL | AV or phone call |

### Termination reason

| Value        | Description               |
| ------------ | ------------------------- |
| GuestLeft    | Client has disconnected   |
| OperatorLeft | Operator has disconnected |
| ChatbotLeft  | Chatbot has disconnected  |

### General settings

| Value                                    | Description                                       |
| ---------------------------------------- | ------------------------------------------------- |
| guestPreview                             | Waiting client preview                            |
| phoneNumberBlockMinutes                  | Same number block length for CMB widget           |
| widgetStateWhenAway                      | Widget state when Away                            |
| emailTranscriptFrom                      | Recipient of reply to session transcript          |
| allowOfflinePhoneCalls                   | Allow offline Callback                            |
| deleteSessionFiles                       | Delete files after session ends                   |
| guestInfinityChat                        | Client chat history                               |
| operatorCanBan                           | Banning clients by operator                       |
| recordSession                            | A/V session recording                             |
| autoAnonymizeSessions                    | Automatically anonymize old sessions              |
| guestUploadFiles                         | Client upload files                               |
| guestDisconnectedTime                    | Client disconnected duration                      |
| operatorCanChooseCallerId                | Selecting an outbound phone number by an operator |
| showRoutedOperators                      | Show routed operators                             |
| emailRoutingRequestsThrottlingPrecedence | Sorting and routing of e-mails                    |
