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

# Overview

## Fundamentals

The BlobHub WebSocket protocol is designed to be used in real-time applications, allowing for efficient and low-latency
data exchange between clients and servers.

## Messages

All messages between clients and BlobHub server follow the [JSON-RPC 2.0](https://www.jsonrpc.org/specification)
specification.

### Requests

Requests are sent from the client to the server or vice versa, to initiate an operation.

```json theme={null}
{
  jsonrpc: "2.0";
  id: string | number;
  method: string;
  params?: {
    [key: string]: unknown;
  };
}
```

### Responses

Responses are sent in reply to requests, containing the result or error of the operation.

```json theme={null}
{
  jsonrpc: "2.0";
  id: string | number;
  result?: {
    [key: string]: unknown;
  }
  error?: {
    code: number;
    message: string;
    data?: unknown;
  }
}
```

### Error Codes

The following standard error codes are used in the protocol:

| Code | Description          |
| ---- | -------------------- |
| 400  | Invalid syntax       |
| 403  | Access forbidden     |
| 405  | Method not supported |
| 500  | Unexpected failure   |
