> 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.

# BulkCommit

POST https://api//api/public/voice/BulkCommit
Content-Type: application/json

Assign voices to many senders in one call. All or nothing: one invalid entry rejects the whole batch. Each entry takes exactly one of `predefinedVoiceId`, `customVoiceId` or `elevenLabsVoiceId`, under the same rules as **SetSenderVoice**.

### Errors

- **400** `VOICE_ASSIGNMENTS_MISSING`, `VOICE_SELECTION_INVALID`, `VOICE_ASSIGNMENTS_DUPLICATE_ACCOUNT`, `LINKEDIN_ACCOUNT_NOT_FOUND`, `CUSTOM_VOICE_UNAVAILABLE`, `PREDEFINED_VOICE_UNAVAILABLE` or `ELEVENLABS_VOICE_OTHER_WORKSPACE`. Note that an unknown account is a **400** here, not a 404.
- **403** `NO_ACTIVE_SUBSCRIPTION`, `VOICE_NOTES_NOT_ENABLED`, or `ELEVENLABS_NOT_ENABLED` for an ElevenLabs entry.
- **404** `ELEVENLABS_VOICE_NOT_FOUND` or `ELEVENLABS_VOICE_ACCESS_DENIED` for an ElevenLabs entry.
- **409** `ELEVENLABS_NOT_CONNECTED` for an ElevenLabs entry.

Reference: https://docs.heyreach.io/hey-reach-api/voice/bulk-commit

## Request

### 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.

- `assignments` (list of BulkCommitVoiceRequestAssignmentsItem, required)

## Errors

### 400 Bulk Commit Voice Request Bad Request Error

Bad Request. `VOICE_ASSIGNMENTS_MISSING`: `assignments` is missing or empty. `VOICE_SELECTION_INVALID`: an entry does not set exactly one voice id. `VOICE_ASSIGNMENTS_DUPLICATE_ACCOUNT`: the same `accountId` appears twice. `LINKEDIN_ACCOUNT_NOT_FOUND`: one or more accounts are not in the workspace. `CUSTOM_VOICE_UNAVAILABLE`: one or more custom voices are missing or not ready (the message lists their ids). `PREDEFINED_VOICE_UNAVAILABLE`: one or more predefined voices are missing or no longer offered (the message lists their ids). `ELEVENLABS_VOICE_OTHER_WORKSPACE`: an ElevenLabs voice was imported into another workspace.

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

### 403 Bulk Commit 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 entry names an ElevenLabs voice 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 Bulk Commit Voice Request Not Found Error

Not Found. `ELEVENLABS_VOICE_NOT_FOUND`: an ElevenLabs voice is not in the imported library or was removed in ElevenLabs. `ELEVENLABS_VOICE_ACCESS_DENIED`: the workspace's ElevenLabs account can no longer use a voice.

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

### 409 Bulk Commit Voice Request Conflict Error

Conflict. `ELEVENLABS_NOT_CONNECTED`: an entry names an ElevenLabs voice while the workspace has no ElevenLabs key connected.

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

## Types

### BulkCommitVoiceRequestAssignmentsItem

- `accountId` (integer, required)
- `predefinedVoiceId` (integer, optional, nullable)
- `customVoiceId` (integer, optional, nullable)
- `elevenLabsVoiceId` (string, optional, nullable)
- `genderOverride` (enum, optional, nullable) — Optional. Sets the sender's gender, as if chosen by a user.
  - Allowed values: `UNKNOWN`, `MALE`, `FEMALE`

## Examples

**Request**

```json
{
  "assignments": [
    {
      "accountId": 12345,
      "predefinedVoiceId": 3
    },
    {
      "accountId": 12346,
      "customVoiceId": 812
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api//api/public/voice/BulkCommit"

payload = { "assignments": [
        {
            "accountId": 12345,
            "predefinedVoiceId": 3
        },
        {
            "accountId": 12346,
            "customVoiceId": 812
        }
    ] }
headers = {
    "X-API-KEY": "<string>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api//api/public/voice/BulkCommit';
const options = {
  method: 'POST',
  headers: {'X-API-KEY': '<string>', 'Content-Type': 'application/json'},
  body: '{"assignments":[{"accountId":12345,"predefinedVoiceId":3},{"accountId":12346,"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/BulkCommit"

	payload := strings.NewReader("{\n  \"assignments\": [\n    {\n      \"accountId\": 12345,\n      \"predefinedVoiceId\": 3\n    },\n    {\n      \"accountId\": 12346,\n      \"customVoiceId\": 812\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", 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/BulkCommit")

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

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<string>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"assignments\": [\n    {\n      \"accountId\": 12345,\n      \"predefinedVoiceId\": 3\n    },\n    {\n      \"accountId\": 12346,\n      \"customVoiceId\": 812\n    }\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.post("https://api//api/public/voice/BulkCommit")
  .header("X-API-KEY", "<string>")
  .header("Content-Type", "application/json")
  .body("{\n  \"assignments\": [\n    {\n      \"accountId\": 12345,\n      \"predefinedVoiceId\": 3\n    },\n    {\n      \"accountId\": 12346,\n      \"customVoiceId\": 812\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api//api/public/voice/BulkCommit', [
  'body' => '{
  "assignments": [
    {
      "accountId": 12345,
      "predefinedVoiceId": 3
    },
    {
      "accountId": 12346,
      "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/BulkCommit");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-KEY", "<string>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"assignments\": [\n    {\n      \"accountId\": 12345,\n      \"predefinedVoiceId\": 3\n    },\n    {\n      \"accountId\": 12346,\n      \"customVoiceId\": 812\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

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

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