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

# Ping

> Optional client-initiated ping to verify connectivity; server responds with a Pong message.

<Note>Public channel. Connect to: `wss://wss.prime.kraken.com/ws/v1`</Note>

Pings may be optionally initiated by the client. They are not required to keep the session alive. On a valid request, the server responds with a `Pong` message. If `data` is omitted or empty, the server responds with an `error` message instead.

## Request

<Tabs>
  <Tab title="Request Schema">
    <ParamField path="reqid" type="number" required>
      A unique number that identifies this ping request.
    </ParamField>

    <ParamField path="type" type="string" required>
      Request type. Value: `Ping`
    </ParamField>

    <ParamField path="ts" type="string" required>
      An ISO-8601 UTC string of the form `2019-02-13T05:17:32.000000Z`.
    </ParamField>

    <ParamField path="data" type="array" required>
      Non-empty list of objects that is forwarded in the `Pong` response. Must contain at least one object; an empty array is rejected.
    </ParamField>
  </Tab>

  <Tab title="Example">
    ```json theme={null}
    {
      "reqid": 2,
      "type": "Ping",
      "ts": "2024-01-13T05:17:32.000000Z",
      "data": [
        {}
      ]
    }
    ```
  </Tab>
</Tabs>

## Response

<Tabs>
  <Tab title="Pong Schema">
    <ParamField path="reqid" type="number" required>
      The request ID from the ping request.
    </ParamField>

    <ParamField path="type" type="string" required>
      Response type. Value: `Pong`
    </ParamField>

    <ParamField path="seqNum" type="number">
      Sequence number, always 0 for ping/pong when present. This field may be omitted from the response.
    </ParamField>

    <ParamField path="ts" type="string" required>
      An ISO-8601 UTC string of the form `2019-02-13T05:17:32.000000Z`.
    </ParamField>

    <ParamField path="data" type="array" required>
      Objects forwarded from the ping request `data` array.
    </ParamField>
  </Tab>

  <Tab title="Pong Example">
    ```json theme={null}
    {
      "reqid": 2,
      "type": "Pong",
      "ts": "2024-01-13T05:17:32.002500Z",
      "data": [
        {}
      ]
    }
    ```
  </Tab>

  <Tab title="Error Schema">
    Returned when `data` is omitted or empty.

    <ParamField path="reqid" type="number" required>
      The request ID from the ping request.
    </ParamField>

    <ParamField path="type" type="string" required>
      Response type. Value: `error`
    </ParamField>

    <ParamField path="seq" type="number" required>
      Sequence number for the error response. Error responses use `seq`, not `seqNum`.
    </ParamField>

    <ParamField path="ts" type="string" required>
      An ISO-8601 UTC string of the form `2019-02-13T05:17:32.000000Z`.
    </ParamField>

    <ParamField path="error" type="object" required>
      Error details.

      <Expandable title="properties">
        <ParamField path="code" type="number" required>
          Error code.
        </ParamField>

        <ParamField path="msg" type="string" required>
          Human-readable error message.
        </ParamField>
      </Expandable>
    </ParamField>
  </Tab>

  <Tab title="Error Example">
    If `data` is omitted:

    ```json theme={null}
    {
      "reqid": 2,
      "type": "Ping",
      "ts": "2024-01-13T05:17:32.000000Z"
    }
    ```

    The server responds with:

    ```json theme={null}
    {
      "reqid": 2,
      "type": "error",
      "seq": 1,
      "ts": "2024-01-13T05:17:32.002500Z",
      "error": {
        "code": 1,
        "msg": "missing Ping data"
      }
    }
    ```

    If `data` is an empty array, the same error is returned.
  </Tab>
</Tabs>

## Notes

* `data` is required and must contain at least one object. Requests that omit `data`, or send `"data": []`, are rejected with `"missing Ping data"`.
* Any objects included in `data` are echoed back unchanged in the `Pong` response.
* `seqNum` may be omitted from successful `Pong` responses.
* Error responses use `seq` (not `seqNum`) and include an `error` object with `code` and `msg` fields.
