Skip to main content
PATCH
/
personas
/
{persona_id}
Update persona
curl --request PATCH \
  --url https://api.coval.dev/v1/personas/{persona_id} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "voice_name": "aria",
  "language_code": "en-US",
  "wait_seconds": 0.8
}
'
import requests

url = "https://api.coval.dev/v1/personas/{persona_id}"

payload = {
"voice_name": "aria",
"language_code": "en-US",
"wait_seconds": 0.8
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({voice_name: 'aria', language_code: 'en-US', wait_seconds: 0.8})
};

fetch('https://api.coval.dev/v1/personas/{persona_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coval.dev/v1/personas/{persona_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'voice_name' => 'aria',
'language_code' => 'en-US',
'wait_seconds' => 0.8
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.coval.dev/v1/personas/{persona_id}"

payload := strings.NewReader("{\n \"voice_name\": \"aria\",\n \"language_code\": \"en-US\",\n \"wait_seconds\": 0.8\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.coval.dev/v1/personas/{persona_id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"voice_name\": \"aria\",\n \"language_code\": \"en-US\",\n \"wait_seconds\": 0.8\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.coval.dev/v1/personas/{persona_id}")

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

request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"voice_name\": \"aria\",\n \"language_code\": \"en-US\",\n \"wait_seconds\": 0.8\n}"

response = http.request(request)
puts response.read_body
{
  "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",
    "background_sound_volume": 0.3,
    "voice_volume": 1.25,
    "voice_speed": 0.85,
    "wait_seconds": 0.5,
    "conversation_initiation": "speak_first",
    "multi_language_stt": true,
    "hold_music_timeout_seconds": 15,
    "tags": [
      "voice",
      "english"
    ],
    "update_time": "2025-01-24T12:30:00Z"
  }
}
{
"error": {
"code": "INVALID_ARGUMENT",
"message": "Invalid language_code 'en-ZZ'"
}
}
{
"error": {
"code": "UNAUTHENTICATED",
"message": "Missing or invalid API key"
}
}
{
"error": {
"code": "NOT_FOUND",
"message": "Persona abc123 not found"
}
}
{
"error": {
"code": "INTERNAL",
"message": "An unexpected error occurred"
}
}

Authorizations

X-API-Key
string
header
required

API key for authentication

Path Parameters

persona_id
string
required

Persona resource ID

Body

application/json

All fields are optional. Only provided fields will be updated.

name
string | null

Human-readable persona name

Required string length: 1 - 200
persona_prompt
string | null

Instructions describing persona behavior and personality

voice_name
string | null

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

language_code
string | null

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.

background_sound
string | null

Built-in background sound id, or custom:<background_sound_id> for an active custom sound returned by GET /personas/background-sounds.

Maximum string length: 100
Pattern: ^(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|backchanneling|custom:[A-Za-z0-9_-]+)$
background_sound_volume
number<float> | null

Volume level for background sound (>= 0.0, no upper limit).

Required range: x >= 0
Example:

0.3

voice_volume
number<float> | null

Voice gain multiplier. Send null to clear an existing configured volume.

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

1.25

voice_speed
number<float> | null

Voice speed multiplier accepted and stored from 0.25 to 2.0. Send null to clear an existing configured speed. The selected voice may enforce a narrower effective range or ignore speed changes.

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

0.85

wait_seconds
number<float> | null

Response delay in seconds

Required range: 0.1 <= x <= 2
conversation_initiation
enum<string> | null

Who initiates the conversation

Available options:
speak_first,
wait_for_user
multi_language_stt
boolean | null

Enable multilingual speech-to-text so callers speaking languages other than the primary language_code are still transcribed accurately.

Example:

true

hold_music_timeout_seconds
number<float> | null

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

Required range: 5 <= x <= 300
tags
string[] | null

Tags to associate with this persona. Null or omitted leaves tags unchanged. Pass [] to clear all tags.

Example:
["voice"]

Response

Persona updated successfully

persona
object
required

Persona resource representation returned by API responses.