GoliathDevelopersGet an API key
Reference/Employeesgenerated from the gateway manifest

listEmployeeVoices

The voices an AI employee can speak in on calls.

POST/api/v1/callREADreadruns as the key's owner
View as Markdown

The voices an AI employee can speak in on calls: voiceId, name, and gender, accent, age and description to match what the person asked for ("a natural woman's voice", "an American accent"). With no search, the recommended list its page's voice picker shows first. With search (a name or words like "deep" or "british"; gender and accent narrow it), the matching voices in our voice workspace (source ACCOUNT) and then the shared voice library (source COMMUNITY), the same search the picker runs. To change the voice, updateEmployeeConfig with configPatch { channels: { callConfig: { voice: { voiceId } } } } and one of these ids; the voice's name, gender, accent and sample follow the id, and a library voice is added to the workspace when it is saved. previewUrl is a sample the person can play. Only an employee that answers or places calls has a voice (channels.callConfig in getEmployee's configDocument, whose voice is the current one).

curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operationId": "listEmployeeVoices",
    "variables": {}
  }'
import { GoliathClient } from '@goliath-data/sdk'

const goliath = new GoliathClient({
  apiKey: process.env.GOLIATH_API_KEY!,
  baseUrl: 'https://server.goliathdata.com',
})

const result = await goliath.employees.listEmployeeVoices({})
const res = await fetch('https://server.goliathdata.com/api/v1/call', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.GOLIATH_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    operationId: 'listEmployeeVoices',
    variables: {}
  }),
})
const { data, errors } = await res.json()

Variables

The example sends only what the schema requires. Some operations also need one of several optional variables (one filter or another, say); the description above says which.

searchString
genderString
accentString

Response

What comes back under data: a list shows as one entry, and a value as its type.

response shape
{
  "data": {
    "aiEmployeesQuery": {
      "recommendedVoices": [
        {
          "voiceId": "…",
          "name": "…",
          "gender": "…",
          "accent": "…",
          "age": "…",
          "description": "…",
          "previewUrl": "…",
          "source": "ACCOUNT"
        }
      ]
    }
  }
}

Errors

Behaviour

A read. It rejects an Idempotency-Key header with 400 bad_request.