---
title: "Subscription Response"
url: https://docs.truemarkets.co/api/websocket/market-data/subscription-response
description: "Acknowledgement sent from server in response to a subscribe or unsubscribe request."
---

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

# Subscription Response

True Markets Market Data WebSocket sends these messages to you.

Address: `/v1/defi/market`

## Servers

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

## Messages

### subscriptionResponse

Acknowledgement of a subscribe or unsubscribe request. Partial-apply: accepted topics are always applied; rejected topics set status to `error` without closing the connection.

Payload: `SubscriptionResponsePayload`

Example payload:

```json
{
  "type": "subscribe",
  "status": "success",
  "timestamp": 0,
  "message": "string",
  "topics": [
    "all"
  ],
  "rejected": [
    {
      "topic": "string",
      "reason": "empty_topic"
    }
  ]
}
```

## Types

```ts
export type SubscriptionResponseMessage = SubscriptionResponsePayload;

export interface SubscriptionResponsePayload {
  type: "subscribe" | "unsubscribe";

  /** `success` when every requested topic was accepted; `error` when one or more were rejected (accepted topics are still applied). */
  status: "success" | "error";

  /** Unix timestamp (seconds) when the response was generated. */
  timestamp: number;

  /** Human-readable description of the result. */
  message?: string;

  /** Accepted (applied) topics by canonical key. Omitted when none were accepted. */
  topics?: Topic[];

  /** Topics that could not be parsed, with reasons. Present only when status is `error`. */
  rejected?: RejectedTopic[];
}

/**
 * Topic identifier. `all` is a wildcard alias for every stream (per-instrument
 * topics excluded). Per-instrument topics are parameterized:
 * `orderbook.{venue}.{pair}` (e.g. `orderbook.hyperliquid-perp.BTC-USD`),
 * `price.{SYMBOL}` (e.g. `price.BTC`, `price.BTC-PERP`),
 * `candles.{SYMBOL}.{interval}` (e.g. `candles.ETH.1h`) and
 * `reference.{SYMBOL}` (e.g. `reference.BTC`). They are subscribable but not
 * part of the fixed enum below and are never delivered to `all` subscribers.
 *
 */
export type Topic =
  | "all"
  | "price_candles"
  | "trending_assets"
  | "surging_assets"
  | "reference_prices";

/** A requested topic that could not be parsed, with the reason. */
export interface RejectedTopic {
  /** The rejected raw topic string as sent by the client. */
  topic: string;

  /** Why the topic was rejected. */
  reason: "empty_topic" | "unknown_channel" | "unsupported_channel" | "invalid_topic_format" | "topic_limit_exceeded" | "unclassified";
}
```