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

# Check Websocket

> Returns the instance's current WebSocket configuration

**Auth:** `TokenAccount` or `TokenInstance` • **Rate limit:** `Global` (100/min) • **Idempotent:** yes

## Description

Returns the instance's current WebSocket configuration. Returns `404` when there is no row in `websocket_configs` (the instance was never configured via `POST`), there is no "implicit default config".

<Note>
  Watch the spelling: the correct path is **`getWebsocket`** (lowercase `w` in `socket`), different from `POST /websocket`. This inconsistency is historical, use the exact literal from the registry.
</Note>

## Path parameters

<ParamField path="instance" type="string" required>
  Instance name.
</ParamField>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://ryzeapi.cloud/api/events/getWebsocket/$Instance_Name" \
    -H "token: $Token_Instance"
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/events/getWebsocket/${process.env.Instance_Name}`, {
    method: "GET",
    headers: {
      "token": process.env.Token_Instance
    }
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.get(
      f"https://ryzeapi.cloud/api/events/getWebsocket/{os.environ['Instance_Name']}",
      headers={
          "token": os.environ["Token_Instance"]
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
  )

  func main() {
      req, _ := http.NewRequest("GET", "https://ryzeapi.cloud/api/events/getWebsocket/"+os.Getenv("Instance_Name"), nil)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

## Headers

<ParamField header="token" type="string" required>
  `TokenAccount` or `TokenInstance`.
</ParamField>

## Success response

Returns the `websocket` object with the current configuration: `enabled`, `events` and `mediaBase64`. Note: `404` means "never configured" (no row in `websocket_configs`), **different** from `enabled=false` (which returns `200` with the persisted row and the fields cleared). Handle both cases on the client.

```json 200 OK theme={null}
{
  "success": true,
  "message": "WebSocket configuration retrieved",
  "websocket": {
    "enabled":     true,
    "events":      ["message.exchange"],
    "mediaBase64": false
  }
}
```

```json 200 OK (disabled) theme={null}
{
  "success": true,
  "message": "WebSocket configuration retrieved",
  "websocket": {
    "enabled":     false,
    "events":      [],
    "mediaBase64": false
  }
}
```

## Errors

| HTTP | `error.message`                              |
| ---- | -------------------------------------------- |
| 401  | `Invalid token`                              |
| 404  | `Instance not found`                         |
| 404  | `WebSocket not configured for this instance` |
| 429  | `Rate limit exceeded. Try again later.`      |
| 500  | `Failed to get instance`                     |
| 500  | `Failed to get websocket configuration`      |

Envelope:

```json theme={null}
{
  "success": false,
  "error": { "message": "WebSocket not configured for this instance" }
}
```

## Notes

<Note>
  * **`404` ≠ "disabled"**: `404` means "never created a row"; an `enabled=false` returns `200` normally with `"enabled": false`. Handle both cases on the client.
  * **No `GET /websocket/:instance` alias**: unlike the webhook, **there is no** alias with the "regular" spelling, only `getWebsocket` (lowercase).
</Note>

## Next

<CardGroup cols={2}>
  <Card title="Configure WebSocket" icon="plug" href="/en/api/events/websocket-configure">
    `POST /api/events/websocket/:instance`
  </Card>

  <Card title="Connect via WebSocket" icon="bolt" href="/en/api/websocket">
    `GET /ws/:instance`
  </Card>
</CardGroup>
