> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inworld.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish a voice

> Inworld Voice API reference: publish a designed preview voice to your voice library so you can use it for speech synthesis.

After [designing a voice](https://docs.inworld.ai/api-reference/voiceAPI/voiceservice/design-voice.md), publish the chosen preview to your voice library. You can then use it to [synthesize speech](https://docs.inworld.ai/api-reference/ttsAPI/texttospeech/synthesize-speech.md) like any other voice.

## API reference

**Endpoint:** `POST https://api.inworld.ai/voices/v1/voices/{voiceId}:publish`

### Authorization

- `Authorization` (string; required) — Your [API key](../../../api-reference/introduction). Read permissions are required for GET endpoints. Write permissions are required for POST, PATCH, and DELETE endpoints.
  
   For Basic authentication, please populate `Basic $INWORLD_API_KEY`. You can create a key in one command with the [Inworld CLI](../../../developer-tools/inworld-cli): `inworld workspace add-key`.

### Path parameters

- `voiceId` (string; required) — Voice ID of the draft voice to publish. Expected format: `{workspace}__{voice}`.

### Request body

Content type: `application/json`

- `displayName` (string) — The name of the voice shown in your voice library.
- `description` (string) — Description of the voice.
- `tags` (string[]) — Optional labels for filtering and discovery (e.g., "demo", "custom").

#### Request example

```json
{
  "displayName": "John",
  "description": "A warm, friendly voice for customer support.",
  "tags": [
    "support",
    "conversational"
  ]
}
```

### Response

Status: `200`. Content type: `application/json`.

- `voiceId` (string) — Voice ID. SYSTEM voices use a simple name (e.g. `Alex`); IVC voices are workspace-prefixed (`{workspace}__{voice}`).
- `langCode` (enum<string>; options: "EN_US", "ZH_CN", "KO_KR", "JA_JP", "RU_RU", "AUTO", "IT_IT", "ES_ES", "PT_BR", "DE_DE", "FR_FR", "AR_SA", "PL_PL", "NL_NL", "HI_IN", "HE_IL") — Primary language of the voice in upper-snake format (e.g. `EN_US`). Note that when filtering via `lang_code`, you can pass BCP-47 (`en-US`), underscore form (`en_US`), or a language prefix (`en`) — but the response always returns upper-snake.
- `languageCode` (string) — Canonical wire form of the voice's primary language as a single string (e.g. `en-US`, `es-MX`, `vi`). Populated on every read alongside the legacy `langCode` enum. Immutable after creation.
- `displayName` (string) — The human-readable name shown anywhere the voice is listed or selected.
- `description` (string) — Longer blurb that explains the voice's tone, accent, use cases, or other relevant attributes.
- `tags` (string[]) — Free-form labels for filtering, grouping, and discovery (e.g. `british`, `calm`).
- `name` (string) — Resource identifier. Workspace voices use workspaces/{workspace}/voices/{voice}; system and shared voices may use a bare identifier. For synthesis and audio previews, use voiceId unchanged instead of constructing a resource path.
- `source` (enum<string>; options: "SYSTEM", "IVC", "TVD", "PVC", "OTHER") — Voice provenance: SYSTEM (Inworld system voice), IVC (instant voice clone), TVD (voice design), PVC (professional or supplied custom voice), or OTHER. Treat provenance separately from community-sharing and ownership metadata.
- `gender` (enum<string>; options: "male", "female", "neutral", "") — Voice gender (`male`, `female`, `neutral`). Empty string if unspecified. Voices with no gender are excluded when filtering with an explicit `gender =` predicate.
- `ageGroup` (enum<string>; options: "young", "middle_aged", "elderly", "") — Age group of the voice (`young`, `middle_aged`, `elderly`). Empty string if unspecified.
- `categories` (enum<string>[]) — Use-case categories the voice belongs to. Filterable with the `:` (has) operator.
  
  Supported values: `companions`, `enterprise`, `education_training`, `developer_assistants`, `healthcare`, `interactive_media`.
- `promptLanguages` (string[]) — Every language the voice can speak, in BCP-47 format (e.g. `en-US`): its source language first, then each language it has been localized to. A voice without localizations has one entry; a voice whose language is detected automatically has none. Returned by both listing and getting a voice.
- `owned` (boolean) — For a community voice result, whether the calling workspace owns the voice. Interpret alongside community-sharing metadata; this field is not a general test for whether synthesis is permitted.

### Response examples

#### 200: default_response

```json
{
  "name": "workspaces/your_workspace_id/voices/design-voice-38b05df9",
  "langCode": "EN_US",
  "displayName": "John",
  "description": "A warm, friendly voice for customer support.",
  "tags": [
    "support",
    "conversational"
  ],
  "voiceId": "your_workspace_id__design-voice-38b05df9",
  "source": "IVC"
}
```

#### default: default_response

```json
{
  "code": 0,
  "message": "string",
  "details": [
    {
      "@type": "string"
    }
  ]
}
```

### Code examples

#### cURL

```bash
curl --location 'https://api.inworld.ai/voices/v1/voices/<voice-id>:publish' \
--header "Authorization: Basic $INWORLD_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
  "displayName": "John",
  "description": "A warm, friendly voice for customer support.",
  "tags": ["support", "conversational"]
}'
```

#### Python

```python
import requests

voice_id = "<voice-id>"
url = f"https://api.inworld.ai/voices/v1/voices/{voice_id}:publish"
headers = {
    "Authorization": "Basic <api-key>",
    "Content-Type": "application/json"
}
payload = {
    "displayName": "John",
    "description": "A warm, friendly voice for customer support.",
    "tags": ["support", "conversational"]
}

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

#### JavaScript

```javascript
const voiceId = '<voice-id>';
const url = `https://api.inworld.ai/voices/v1/voices/${voiceId}:publish`;

const response = await fetch(url, {
  method: 'POST',
  headers: {
    'Authorization': 'Basic <api-key>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    displayName: 'John',
    description: 'A warm, friendly voice for customer support.',
    tags: ['support', 'conversational'],
  }),
});

const data = await response.json();
console.log(data);
```
