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

> ## Agent Instructions
> If you are building a Canton Network application, start from https://docs.canton.network/appdev/quickstart.md. To run only a local network for your own Daml code, without building the QuickStart demo, see https://docs.canton.network/sdks-tools/development-tools/localnet.md.

# Subscribe hosted parties

> Returns a stream of the snapshot of the hosted parties at a ledger offset, which are  satisfying the request's query parameters. Once the stream of GetHostedParties completes, the client SHOULD begin streaming topology updates from the update service, starting at the ``GetHostedPartiesResponse``.``hosted_at_offset``. Clients SHOULD NOT assume that the set of hosted parties they receive reflects the state at the ledger end.
Required permissions: ``ledger:read``

[JSON API AsyncAPI](https://docs.canton.network/reference/json-api-asyncapi-reference/index.md)

›

[/v2/state/hosted-parties](https://docs.canton.network/reference/json-api-asyncapi-reference/channels/v2-state-hosted-parties.md)

›

subscribe

/v2/state/hosted-parties

# Subscribe hosted parties

WebSocket

[Added 3.8](#history-added-3-8)

SUBSCRIBE

`/v2/state/hosted-parties`

Returns a stream of the snapshot of the hosted parties at a ledger offset, which are  satisfying the
request's query parameters.
Once the stream of GetHostedParties completes,
the client SHOULD begin streaming topology updates from the update service,
starting at the `GetHostedPartiesResponse`.`hosted_at_offset`.
Clients SHOULD NOT assume that the set of hosted parties they receive reflects the state at the ledger end.

Required permissions: `ledger:read`

## Protocol Details

Protocol
WebSocket

Channel
/v2/state/hosted-parties

Action
subscribe

Operation ID
onV2StateHosted-parties

Content type
application/json

Payload
oneOf

## Inputs

## Outputs

### Either\_JsCantonError\_GetHostedPartiesResponse

Direction
Server -> Client

Message
Either\_JsCantonError\_GetHostedPartiesResponse

Variants

#### GetHostedPartiesResponse

object

`hostedParty`
object

required

`hostedAtOffset`
string

required

`streamContinuationToken`
string

required

#### JsCantonError

object

`code`
string

required

`cause`
string

required

`context`
object

required

`errorCategory`
string

required

## Related Schemas

> [accordion] Either\_JsCantonError\_GetHostedPartiesResponse
>
> Variants
>
> #### GetHostedPartiesResponse
>
> object
>
> `hostedParty`
> object
>
> required
>
> `hostedAtOffset`
> string
>
> required
>
> `streamContinuationToken`
> string
>
> required
>
> #### JsCantonError
>
> object
>
> `code`
> string
>
> required
>
> `cause`
> string
>
> required
>
> `context`
> object
>
> required
>
> `errorCategory`
> string
>
> required

## History

Added
`3.8`

wscat

```bash wscat theme={"theme":{"light":"github-light","dark":"github-dark"}}
npx wscat -c <WEBSOCKET_URL>
```

message

application/json

```json message theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "hostedParty": {
    "party": "<string>",
    "hostingParticipants": [
      {
        "participantId": "<string>",
        "synchronizerId": "<string>",
        "recordTime": "<string>",
        "offset": "<integer>",
        "participantPermission": "<string>",
        "hostingState": "<string>"
      }
    ]
  },
  "hostedAtOffset": "<integer>",
  "streamContinuationToken": "<string>"
}
```
