> This page is for version v2026.01.16-dev.
> For other versions, use one of these documentation indexes:
> - latest (default): https://docs.machanirobotics.dev/latest/llms.txt
> - v2026.01.16-dev: https://docs.machanirobotics.dev/v-2026-01-16-dev/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.machanirobotics.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.machanirobotics.dev/_mcp/server.

# Update Speech

PATCH https://api.machanirobotics.com/v1/conversation/speech/speeches/{speeche}
Content-Type: application/json

Updates an existing Speech resource.
HTTP Mapping: PATCH /v1/conversation/speech/\{speech.name=speeches/\*}

Reference: https://docs.machanirobotics.dev/v-2026-01-16-dev/2026-01-16-dev/latest/speech-service/updatespeech

## Request

### Path parameters

- `speeche` (string, required) — The speeche id.

### Query parameters

- `updateMask` (string, optional) — update_mask specifies the set of fields to be updated in the Speech resource. This enables partial updates by listing only the modified field paths.

### Body (application/json)

This endpoint expects a Speech.

- `displayName` (string, required) — display name contains the display name for the relevant speech.
- `content` (string, required) — content contains the actual textual content to be converted into speech. This field is required to generate the speech output.
- `service` (integer, required) — service specifies the speech processing service to use for generating the speech. It must be one of the defined values in the SpeechProcessingService enum.
- `languageTag` (InferenceLanguage, required) — language specifies the language of the speech content.
- `name` (string, optional) — name is the resource identifier for the Speech. It follows the format "speeches/\{speech}" and uniquely identifies a Speech resource.
- `speed` (double, optional) — speed defines the playback speed of the generated speech. This optional field allows for customization of the speech delivery rate.
- `outputFormat` (integer, optional) — output_format determines the file format for the synthesized speech audio, such as MP3 or WAV. This field is optional and depends on the capabilities of the selected service.
- `duration` (string, optional) — duration specifies the maximum length of the speech output in seconds. This field is required to limit the length of the generated speech.
- `audioUri` (string, optional) — Storage URI for the synthesized speech audio. This field is optional and depends on the capabilities of the selected service.
- `type` (integer, optional) — type specifies the storage behavior of the speech output. It indicates whether the generated speech should be persisted for future reference or treated as transient.

## Response

### 200

OK

- `displayName` (string, required) — display name contains the display name for the relevant speech.
- `content` (string, required) — content contains the actual textual content to be converted into speech. This field is required to generate the speech output.
- `service` (integer, required) — service specifies the speech processing service to use for generating the speech. It must be one of the defined values in the SpeechProcessingService enum.
- `languageTag` (InferenceLanguage, required) — language specifies the language of the speech content.
- `name` (string, optional) — name is the resource identifier for the Speech. It follows the format "speeches/\{speech}" and uniquely identifies a Speech resource.
- `speed` (double, optional) — speed defines the playback speed of the generated speech. This optional field allows for customization of the speech delivery rate.
- `outputFormat` (integer, optional) — output_format determines the file format for the synthesized speech audio, such as MP3 or WAV. This field is optional and depends on the capabilities of the selected service.
- `duration` (string, optional) — duration specifies the maximum length of the speech output in seconds. This field is required to limit the length of the generated speech.
- `audioUri` (string, optional) — Storage URI for the synthesized speech audio. This field is optional and depends on the capabilities of the selected service.
- `type` (integer, optional) — type specifies the storage behavior of the speech output. It indicates whether the generated speech should be persisted for future reference or treated as transient.

## Errors

### 400 Bad Request Error

Bad Request

- `code` (integer, optional) — The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
- `message` (string, optional) — A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
- `details` (list of GoogleProtobufAny, optional) — A list of messages that carry the error details. There is a common set of message types for APIs to use.

## Types

### InferenceLanguage

InferenceLanguage is the language code for the robot's conversation.

- `countryTag` (integer, required) — The country code for the robot's conversation.
- `languageTag` (integer, required) — The language code for the robot's conversation.
- `inputAudio` (string, optional) — The audio input for the robot's conversation.
- `inputText` (string, optional) — The text input for the robot's conversation.
- `inputSpeech` (string, optional) — The speech input for the robot's conversation.
- `inputNone` (boolean, optional) — The none input for the robot's conversation.
- `outputAudio` (string, optional) — The audio output for the robot's conversation.
- `outputText` (string, optional) — The text output for the robot's conversation.
- `outputSpeech` (string, optional) — The speech output for the robot's conversation.
- `outputNone` (boolean, optional) — The none output for the robot's conversation.

### GoogleProtobufAny

Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.

- `@type` (string, optional) — The type of the serialized message.

## Examples

**Request**

```json
{
  "displayName": "Welcome Greeting",
  "content": "Hello, welcome to Machani Robotics. How can I assist you today?",
  "service": 2,
  "languageTag": {
    "countryTag": 840,
    "languageTag": 1033
  }
}
```

**Response**

```json
{
  "displayName": "Welcome Greeting",
  "content": "Hello, welcome to Machani Robotics. How can I assist you today?",
  "service": 2,
  "languageTag": {
    "countryTag": 840,
    "languageTag": 1033,
    "inputAudio": "audio/welcome_input.wav",
    "inputText": "Hello, welcome to Machani Robotics.",
    "inputSpeech": "speech/welcome_input.speech",
    "inputNone": false,
    "outputAudio": "audio/welcome_output.mp3",
    "outputText": "Hello, welcome to Machani Robotics. How can I assist you today?",
    "outputSpeech": "speech/welcome_output.speech",
    "outputNone": false
  },
  "name": "speeches/welcome_greeting_001",
  "speed": 1,
  "outputFormat": 2,
  "duration": "5.000s",
  "audioUri": "gs://machani-robotics-audio/speeches/welcome_greeting_001.mp3",
  "type": 1
}
```

**SDK Code**

```python
import requests

url = "https://api.machanirobotics.com/v1/conversation/speech/speeches/speeche"

payload = {
    "displayName": "Welcome Greeting",
    "content": "Hello, welcome to Machani Robotics. How can I assist you today?",
    "service": 2,
    "languageTag": {
        "countryTag": 840,
        "languageTag": 1033
    }
}
headers = {"Content-Type": "application/json"}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.machanirobotics.com/v1/conversation/speech/speeches/speeche';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json'},
  body: '{"displayName":"Welcome Greeting","content":"Hello, welcome to Machani Robotics. How can I assist you today?","service":2,"languageTag":{"countryTag":840,"languageTag":1033}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.machanirobotics.com/v1/conversation/speech/speeches/speeche"

	payload := strings.NewReader("{\n  \"displayName\": \"Welcome Greeting\",\n  \"content\": \"Hello, welcome to Machani Robotics. How can I assist you today?\",\n  \"service\": 2,\n  \"languageTag\": {\n    \"countryTag\": 840,\n    \"languageTag\": 1033\n  }\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.machanirobotics.com/v1/conversation/speech/speeches/speeche")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"displayName\": \"Welcome Greeting\",\n  \"content\": \"Hello, welcome to Machani Robotics. How can I assist you today?\",\n  \"service\": 2,\n  \"languageTag\": {\n    \"countryTag\": 840,\n    \"languageTag\": 1033\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.machanirobotics.com/v1/conversation/speech/speeches/speeche")
  .header("Content-Type", "application/json")
  .body("{\n  \"displayName\": \"Welcome Greeting\",\n  \"content\": \"Hello, welcome to Machani Robotics. How can I assist you today?\",\n  \"service\": 2,\n  \"languageTag\": {\n    \"countryTag\": 840,\n    \"languageTag\": 1033\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.machanirobotics.com/v1/conversation/speech/speeches/speeche', [
  'body' => '{
  "displayName": "Welcome Greeting",
  "content": "Hello, welcome to Machani Robotics. How can I assist you today?",
  "service": 2,
  "languageTag": {
    "countryTag": 840,
    "languageTag": 1033
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.machanirobotics.com/v1/conversation/speech/speeches/speeche");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"displayName\": \"Welcome Greeting\",\n  \"content\": \"Hello, welcome to Machani Robotics. How can I assist you today?\",\n  \"service\": 2,\n  \"languageTag\": {\n    \"countryTag\": 840,\n    \"languageTag\": 1033\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "displayName": "Welcome Greeting",
  "content": "Hello, welcome to Machani Robotics. How can I assist you today?",
  "service": 2,
  "languageTag": [
    "countryTag": 840,
    "languageTag": 1033
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.machanirobotics.com/v1/conversation/speech/speeches/speeche")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```