---
title: "Subscribe"
url: https://docs.truemarkets.co/api/websocket/institutional/subscribe
description: "Message sent to server indicating what channels and data the user would like to subscribe to."
---

Docs index: https://docs.truemarkets.co/llms.txt

# Subscribe

You send these messages to True Markets CeFi WebSocket.

Address: `/v1/cefi/market`

## Servers

- `wss://api.truemarkets.co` (Production, wss)
- `wss://api.uat.truemarkets.co` (Uat, wss)

## Messages

### subscription

Payload: `SubscriptionPayload`

Example payload:

```json
{
  "item_names": [
    "string"
  ],
  "channels": [
    "INSTRUMENT"
  ],
  "timestamp": "string",
  "type": "SUBSCRIBE",
  "organization_id": "string",
  "key": "string",
  "signature": "string"
}
```

## Types

```ts
export type SubscribeMessage = SubscriptionPayload;

export type SubscriptionPayload = {
  /** Action the request is intending to take. */
  type: "SUBSCRIBE" | "SUBSCRIBE_NO_AUTH" | "UNSUBSCRIBE" | "UNSUBSCRIBE_NO_AUTH";

  /** List of items the request is intending to act upon. For market data channels (INSTRUMENT, EBBO, DEPTH, TRADE, AUCTION), this contains instrument symbols. For the INDEX channel, observable ids as strings. For the DROPCOPY channel, this contains client IDs as strings. */
  item_names: string[];

  /** List of channels the request is intending to interact with. Note: DROPCOPY channel requires authentication. HEARTBEAT applies to the connection and ignores item_names. */
  channels: ("INSTRUMENT" | "EBBO" | "DEPTH" | "TRADE" | "AUCTION" | "INDEX" | "DROPCOPY" | "HEARTBEAT")[];

  /**
   * Required field on all requests; a UTC Unix epoch in seconds. Must not be in the future and must be no older than 15 seconds relative to server time.
   *
   */
  timestamp: string;

  /** Exchange designation ID will be UUIDv4. Must be supplied in human readable form. [RFC 9562](https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-4). */
  organization_id?: string;

  /** Exchange supplied API key will be in UUIDv4. Must be supplied in human readable form. [RFC 9562](https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-4). */
  key?: string;

  /** The computed HMAC signature. */
  signature?: string;
} & ({
  type?: "SUBSCRIBE" | "UNSUBSCRIBE";
  organization_id: string;
  key: string;
  signature: string;
} | {
  type?: "SUBSCRIBE_NO_AUTH" | "UNSUBSCRIBE_NO_AUTH";
  organization_id?: string;
  key?: string;
  signature?: string;
});
```