> ## Documentation Index
> Fetch the complete documentation index at: https://developers.chatbrick.com/llms.txt
> Use this file to discover all available pages before exploring further.

# contact.connection.disconnected

> This event is triggered when a contact disconnects from a store or staff member.

<Warning>This event type is in the beta stage; specifications are subject to change at any time.</Warning>

## Event Body Fields

The request event body is a JSON object that contains the following fields:

<ResponseField name="type" type="string">
  `contact.connection.disconnected`
</ResponseField>

<ResponseField name="data" type="Object">
  The object containing the event data.

  <Expandable title="data" defaultOpen>
    <ResponseField name="contact" type="Contact Object">
      <Expandable title="contact">
        <ResponseField name="id" type="string" />

        <ResponseField name="name" type="string" />

        <ResponseField name="avatar" type="string">
          The URL of the contact's avatar.

          <Warning>We don't recommend embedding this image in any webpage because it's not designed for that purpose. If you need to display this image on a webpage, please download it when you receive the event and serve it from your own server to ensure it works as expected.</Warning>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="lineUsers" type="Array of LineUser Object">
      LINE users that belong to the contact. In most cases, there will be only one LINE user.

      <Expandable title="lineUser">
        <ResponseField name="id" type="string" />

        <ResponseField name="name" type="string">
          The name of the LINE user.

          This is the name of the LINE user, it can be different from the contact name in some cases.
        </ResponseField>

        <ResponseField name="lineUid" type="string">
          Learn more about it in [LINE User ID documentation](https://developers.line.biz/en/docs/messaging-api/getting-user-ids/).
        </ResponseField>

        <ResponseField name="lineProviderId" type="string">
          The LINE provider ID of the LINE user in. This value is sent as a string.
        </ResponseField>

        <ResponseField name="profilePictureUrl" type="string">
          The URL of the LINE user's profile picture.

          This URL is provided by LINE and it may already be expired when you receive the event.

          In most cases, you may want to use the avatar from the contact object instead.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="timestamps" type="Object">
      Timestamps in **ISO 8601** format.

      <Expandable title="timestamps">
        <ResponseField name="disconnectedAt" type="string">
          The timestamp of when the user performed the disconnect action.
        </ResponseField>

        <ResponseField name="initConnectedAt" type="string">
          The timestamp when the contact is connected for the first time.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="timestampsMs" type="Object">
      Timestamps are represented in numerical format; the number represents **milliseconds** elapsed since the [epoch](https://en.wikipedia.org/wiki/Unix_time), which is defined as the midnight at the beginning of January 1, 1970, UTC.

      <Expandable title="timestampsMs">
        <ResponseField name="disconnectedAt" type="string">
          The timestamp of when the user performed the disconnect action.
        </ResponseField>

        <ResponseField name="initConnectedAt" type="string">
          The timestamp when the contact is connected for the first time.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Example theme={null}
  {
    "type": "contact.connection.disconnected",
    "data": {
      "contact": {
        "id": "clrq5ca80000lb9c9dnxxfyid",
        "name": "康宜恩",
        "avatar": "https://uc.chatbrick.com/avatar/clrq5ca80000lb9c9dnxxfyid/avatar.jpeg"
      },
      "lineUsers": [
        {
          "id": "clxvsgpgi000001qgdxuka3vj",
          "name": "Mr. Kang",
          "lineUid": "U4d26836f2aadb5ad84cc8b5b729fc9a1",
          "lineProviderId": "1660894172",
          "profilePictureUrl": "https://profile.line-scdn.net/0m0450c48c7251b78e575b3a5bb3c4ea5a7e70d9d2d471"
        }
      ],
      "timestamps": {
        "disconnectedAt": "2024-06-18T18:18:18.000Z",
        "initConnectedAt": "2024-06-08T18:18:18.888Z"
      },
      "timestampsMs": {
        "disconnectedAt": 1718734698000,
        "initConnectedAt": 1717870698888
      }
    }
  }
  ```
</ResponseExample>
