Skip to main content
POST
/
personas
Create persona
curl --request POST \
  --url https://api.coval.dev/v1/personas \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "Friendly Spanish Customer",
  "persona_prompt": "You are a friendly Spanish-speaking customer calling for technical support...",
  "voice_name": "marina",
  "language_code": "es-ES",
  "background_sound": "office",
  "wait_seconds": 0.5,
  "conversation_initiation": "speak_first"
}
'
{
  "persona": {
    "resource_name": "personas/3zfmuDbVQsi4GaseDtiVcS",
    "id": "3zfmuDbVQsi4GaseDtiVcS",
    "name": "Friendly Customer",
    "create_time": "2025-01-24T10:00:00Z",
    "persona_prompt": "You are a friendly customer calling for technical support...",
    "voice_name": "aria",
    "language_code": "en-US",
    "background_sound": "office",
    "wait_seconds": 0.5,
    "conversation_initiation": "speak_first",
    "hold_music_timeout_seconds": 15,
    "update_time": "2025-01-24T12:30:00Z"
  }
}

Authorizations

X-API-Key
string
header
required

API key for authentication

Body

application/json
name
string
required

Human-readable persona name

Required string length: 1 - 200
Example:

"Friendly Customer"

voice_name
string
required

Coval voice name. Use GET /personas/voices to discover available voices and their supported language codes.

Example:

"aria"

language_code
string
required

BCP-47 language code for voice synthesis. Must be supported by the selected voice. Use GET /personas/voices to discover valid voice and language combinations.

Example:

"en-US"

persona_prompt
string | null

Instructions describing persona behavior and personality

Example:

"You are a friendly customer calling for support..."

background_sound
enum<string> | null

Background noise type

Available options:
off,
office,
lounge,
crowd,
airport,
bus,
playground,
doorbell,
train-arrival,
portable-air-conditioner,
skatepark,
small-dog-bark,
cafe,
ferry-and-announcement,
heavy-rain,
moderate-wind,
newborn-baby-crying,
office-with-alarm,
street-with-sirens,
construction-work
Maximum string length: 100
Example:

"office"

wait_seconds
number<float> | null

Response delay in seconds

Required range: 0.1 <= x <= 2
Example:

0.5

conversation_initiation
enum<string> | null

Who initiates the conversation

Available options:
speak_first,
wait_for_user
Example:

"speak_first"

hold_music_timeout_seconds
number<float> | null

Disconnect after this many seconds of no speech (5-300)

Required range: 5 <= x <= 300

Response

Persona created successfully

persona
object
required

Persona resource representation returned by API responses.