# Voices

Manage saved workspace voices and browse platform-recommended voices. Workspace voices are saved ElevenLabs voices scoped to your company. Platform voices are pre-seeded recommended voices available to all workspaces (read-only). Use these with POST /ai/generate-speech.

**Base URL:** `https://api.trustpager.com/functions/v1/api/v1`

## Endpoints

### GET /voices

List all voices -- workspace-saved voices (source: "workspace") and platform-recommended voices (source: "platform"). Workspace voices appear first, then platform voices sorted by sort_order.

**Scopes:** `voices:read` — [full detail](./voices/get-voices.md)

### POST /voices

Save an ElevenLabs voice to the workspace voice library. provider_voice_id is required. Name and preview URL are auto-resolved from ElevenLabs if not provided. Each voice ID can only be saved once per workspace.

**Scopes:** `voices:write` — [full detail](./voices/post-voices.md)

### GET /voices/:id

Get a single workspace-saved voice by ID. Only returns workspace voices (not platform voices).

**Scopes:** `voices:read` — [full detail](./voices/get-voices-id.md)

### PATCH /voices/:id

Update a workspace-saved voice. Can update name, description, model, settings, or set as default. Only workspace voices can be updated.

**Scopes:** `voices:write` — [full detail](./voices/patch-voices-id.md)

### DELETE /voices/:id

Remove a saved voice from the workspace. Only workspace voices can be deleted. Platform voices are read-only.

**Scopes:** `voices:delete` — [full detail](./voices/delete-voices-id.md)

### GET /voices/provider-catalog

List the upstream voice provider catalogue. Returns each voice with its namespaced provider voice_id (e.g. "11labs-Noah"), name, accent, gender, and preview URL. Use this to discover valid values for set_provider_voice_mapping, or to troubleshoot voice rejections when creating or provisioning voice agents.

**Scopes:** `voices:read` — [full detail](./voices/get-voices-provider-catalog.md)

### POST /voices/:id/provider-mapping

Map a local voice (workspace or platform) to a provider-format voice ID so voice agent creation and provisioning use it instead of the fallback voice. Pass a namespaced voice_id (e.g. "11labs-Noah") from GET /voices/provider-catalog. Pass null to clear an existing mapping.

**Scopes:** `voices:write` — [full detail](./voices/post-voices-id-provider-mapping.md)

### POST /voices/sync-provider-catalog

Idempotent sync: pulls the upstream provider catalogue, finds same-provider name matches for every local voice (workspace + platform) missing a mapping, and writes the provider voice ID. Already-mapped voices are skipped unless force=true. Returns matched/skipped/unmatched counts per voice.

**Scopes:** `voices:write` — [full detail](./voices/post-voices-sync-provider-catalog.md)
