---
title: Messaging Protocol
slug: v2-api-docs/messaging-protocol
createdAt: 2025-10-01T12:21:00.570Z
---

jsonrpc is used as a messaging protocol for the socket messages.

To get more information on this messaging protocol, go to <u>https\://www\.jsonrpc.org/specification</u>

::::CodeDrawer{title="Chatting with the assistant (text in, text out)" isResponseExpanded="true"}
:::CodeblockTabsExamples
```javascript
{
    "jsonrpc": "2.0",
    "id": "123",
    "method": "chat",
    "params": {    
        "mediaType": "text/plain", 
        "data": "How are you?"
      }
}
```
:::

:::CodeblockTabsResponses
```javascript
{
    "jsonrpc": "2.0",
    "id": "123",
    "result": {
        "code": "200",
        "message": "Success",
        "data": [
            {
                "mediaType": "text/plain",
                "data": "How may I assist you today?"
            }
        ]
    }
}
```
:::
::::

::::CodeDrawer{title="Chatting with the assistant (voice in, text out)" isResponseExpanded="true"}
:::CodeblockTabsExamples
Request

```javascript
{
    "jsonrpc": "2.0",
    "id": "123",
    "method": "chat",
    "params": {    
        "mediaType": "audio/pcm", 
        "data": "base64_encoded_audio"
      }
}
```

Notification

```none
{
    "jsonrpc": "2.0",
    "method": "voiceTranscription",
    "params": {    
        "id": "123", 
        "text": "transcribed_text"
      }
}
```
:::

:::CodeblockTabsResponses
```javascript
{
    "jsonrpc": "2.0",
    "id": "123",
    "result": {
        "code": "200",
        "message": "Success",
        "data": [
            {
                "mediaType": "text/plain",
                "data": "How may I assist you today?"
            }
        ]
    }
}
```
:::
::::

