> For the complete documentation index, see [llms.txt](https://40factory.gitbook.io/wilson/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://40factory.gitbook.io/wilson/3.11/rest-api/chat/edit-chat-2.md).

# Speech-to-text

## Request <a href="#request" id="request"></a>

### Url

```
POST 
https://wilson.40mat.com/apif/v2/chat/<chat_id>/speech-to-text
```

### Headers

<pre><code><strong>AUTH
</strong>Bearer "eyJ0eXAiOiJKV1QiLCJub25jZSI6IndUZXphSTNjdTNVYj..."
</code></pre>

### Parameters

```
No parameters are required for this endpoint.
```

### Body

```json
{
  "text": "Ciao io sono Wilson"
}
```

The request body is in JSON format contain following properties:

* `text` (string): Text to transform in audio.

***

## Response&#x20;

The response is in JSON format contain following properties:

* `archived` (boolean): Archived status of the chat

```json
{
    "archived": false
}
```

***

## Code example

{% tabs %}
{% tab title="Python" %}

```python
import requests

url = "https://wilson.40mat.com/apif/v2/chat/<chat_id>/speech-to-text"

payload = {
  "title": "Updated chat title",
  "archived": false
}

headers = {
  'Authorization': '••••••'
}

response = requests.request("PATCH", url, headers=headers, json=payload)

print(response.text)
```

{% endtab %}

{% tab title="cURL" %}

```powershell
curl --location 'https://wilson.40mat.com/apif/v2/chat/<chat_id>/speech-to-text' \
--header 'Authorization: ••••••' \
--data '{
  "title": "Updated chat title",
  "archived": false
}'
```

{% endtab %}
{% endtabs %}
