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

# SetSenderVoice

PUT https://api//api/public/voice/SetSenderVoice/{accountId}
Content-Type: application/json

Assign a voice to a sender (LinkedIn account). Provide exactly one of `predefinedVoiceId`, `customVoiceId` or `elevenLabsVoiceId`. An ElevenLabs voice is assigned by its `voiceId` from **GetElevenLabsVoices** as `customVoiceId`, or by its ElevenLabs id as `elevenLabsVoiceId`, which is looked up in the workspace's imported library; ElevenLabs itself is not called. A voice with an `availableUntil` date can still be assigned until that date.

### Errors

- **400** `VOICE_SELECTION_INVALID`, `CUSTOM_VOICE_NOT_READY`, `PREDEFINED_VOICE_UNAVAILABLE` or `ELEVENLABS_VOICE_OTHER_WORKSPACE`.
- **403** `NO_ACTIVE_SUBSCRIPTION`, `VOICE_NOTES_NOT_ENABLED`, or `ELEVENLABS_NOT_ENABLED` for an ElevenLabs voice.
- **404** `LINKEDIN_ACCOUNT_NOT_FOUND`, `CUSTOM_VOICE_NOT_FOUND`, `ELEVENLABS_VOICE_NOT_FOUND` or `ELEVENLABS_VOICE_ACCESS_DENIED`.
- **409** `ELEVENLABS_NOT_CONNECTED`.

Reference: https://docs.heyreach.io/hey-reach-api/voice/set-sender-voice

## Request

### Path parameters

- `accountId` (integer, required)

### Headers

- `X-API-KEY` (string, optional) — API key header using this scheme. Example: "X-API-KEY: \{API\_KEY}"

### Body (application/json)

This endpoint expects an object.

- `predefinedVoiceId` (integer, optional, nullable)
- `customVoiceId` (integer, optional, nullable) — A cloned voice, or an imported ElevenLabs voice (`voiceId` from GetElevenLabsVoices).
- `elevenLabsVoiceId` (string, optional, nullable) — An ElevenLabs voice id that is in the workspace's imported library.

## Errors

### 400 Set Sender Voice Voice Request Bad Request Error

Bad Request. `VOICE_SELECTION_INVALID`: not exactly one voice id is set. `CUSTOM_VOICE_NOT_READY`: the custom or ElevenLabs voice is not READY. `PREDEFINED_VOICE_UNAVAILABLE`: the predefined voice does not exist or is no longer offered. `ELEVENLABS_VOICE_OTHER_WORKSPACE`: the ElevenLabs voice was imported into another workspace; assign a voice from the sender's own workspace.

- `errorMessage` (string, required)
- `errorCode` (enum, optional)
  - Allowed values: `PAGING_OUT_OF_RANGE`

### 403 Set Sender Voice Voice Request Forbidden Error

Forbidden. `NO_ACTIVE_SUBSCRIPTION`: the workspace has no active subscription. `VOICE_NOTES_NOT_ENABLED`: voice notes are not enabled for the workspace. `ELEVENLABS_NOT_ENABLED`: an ElevenLabs voice was given while ElevenLabs voices are not enabled for the workspace.

- `errorMessage` (string, required)
- `errorCode` (enum, optional)
  - Allowed values: `NO_ACTIVE_SUBSCRIPTION`, `VOICE_NOTES_NOT_ENABLED`, `ELEVENLABS_NOT_ENABLED`

### 404 Set Sender Voice Voice Request Not Found Error

Not Found. `LINKEDIN_ACCOUNT_NOT_FOUND`: the account is not in the workspace. `CUSTOM_VOICE_NOT_FOUND`: no such custom voice. `ELEVENLABS_VOICE_NOT_FOUND`: the ElevenLabs voice is not in the imported library or was removed in ElevenLabs; call **RefreshElevenLabsLibrary** and try again. `ELEVENLABS_VOICE_ACCESS_DENIED`: the workspace's ElevenLabs account can no longer use this voice.

- `errorMessage` (string, required)
- `errorCode` (enum, optional)
  - Allowed values: `ELEVENLABS_VOICE_NOT_FOUND`, `ELEVENLABS_VOICE_ACCESS_DENIED`

### 409 Set Sender Voice Voice Request Conflict Error

Conflict. `ELEVENLABS_NOT_CONNECTED`: an ElevenLabs voice was given while the workspace has no ElevenLabs key connected. Keys are connected in the app.

- `errorMessage` (string, required)
- `errorCode` (enum, optional)
  - Allowed values: `ELEVENLABS_NOT_CONNECTED`

## Examples

**Request**

```json
{
  "customVoiceId": 812
}
```

**SDK Code**

```python
import requests

url = "https://api//api/public/voice/SetSenderVoice/1"

payload = { "customVoiceId": 812 }
headers = {
    "X-API-KEY": "<string>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api//api/public/voice/SetSenderVoice/1';
const options = {
  method: 'PUT',
  headers: {'X-API-KEY': '<string>', 'Content-Type': 'application/json'},
  body: '{"customVoiceId":812}'
};

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//api/public/voice/SetSenderVoice/1"

	payload := strings.NewReader("{\n  \"customVoiceId\": 812\n}")

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

	req.Header.Add("X-API-KEY", "<string>")
	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//api/public/voice/SetSenderVoice/1")

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

request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<string>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"customVoiceId\": 812\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.put("https://api//api/public/voice/SetSenderVoice/1")
  .header("X-API-KEY", "<string>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customVoiceId\": 812\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api//api/public/voice/SetSenderVoice/1', [
  'body' => '{
  "customVoiceId": 812
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '<string>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api//api/public/voice/SetSenderVoice/1");
var request = new RestRequest(Method.PUT);
request.AddHeader("X-API-KEY", "<string>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customVoiceId\": 812\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-KEY": "<string>",
  "Content-Type": "application/json"
]
let parameters = ["customVoiceId": 812] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api//api/public/voice/SetSenderVoice/1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```