---
title: "ClientConnection"
description: "one WebSocket the installed app keeps open to the platform: authenticated by the session's token in its first message, carrying progress, task events and file bytes"
section: concepts
address: /concepts/clientconnection
contract: 0476e35e6e275db5
---

# ClientConnection

one WebSocket the installed app keeps open to the platform: authenticated by the session's token in its first message, carrying progress, task events and file bytes

[figure: ClientConnection is a fact at tenant scope. The drawing shows its fields and the objects that they point at.]

| property | value |
|---|---|
| kind | fact |
| scope | tenant |
| key | the session and the connection id |
| store | postgres |
| family | network |



## Fields


| field | type | required | note |
|---|---|---|---|
| `session` | `id` | yes |  |
| `opened_at` | `time` | yes |  |
| `last_message_at` | `time` | yes |  |
| `bytes_in` | `bytes` | yes |  |
| `bytes_out` | `bytes` | yes |  |
| `state` | `one of open \| idle \| closed` | yes |  |



## Routes that use it
No route takes or returns ClientConnection directly. The record holds it, and the objects that point at it reach it.
