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",
"interruption_rate": "MEDIUM"
}
'import requests
url = "https://api.coval.dev/v1/personas"
payload = {
"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",
"interruption_rate": "MEDIUM"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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',
interruption_rate: 'MEDIUM'
})
};
fetch('https://api.coval.dev/v1/personas', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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',
'interruption_rate' => 'MEDIUM'
]),
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"
payload := strings.NewReader("{\n \"name\": \"Friendly Spanish Customer\",\n \"persona_prompt\": \"You are a friendly Spanish-speaking customer calling for technical support...\",\n \"voice_name\": \"marina\",\n \"language_code\": \"es-ES\",\n \"background_sound\": \"office\",\n \"wait_seconds\": 0.5,\n \"conversation_initiation\": \"speak_first\",\n \"interruption_rate\": \"MEDIUM\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.coval.dev/v1/personas")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Friendly Spanish Customer\",\n \"persona_prompt\": \"You are a friendly Spanish-speaking customer calling for technical support...\",\n \"voice_name\": \"marina\",\n \"language_code\": \"es-ES\",\n \"background_sound\": \"office\",\n \"wait_seconds\": 0.5,\n \"conversation_initiation\": \"speak_first\",\n \"interruption_rate\": \"MEDIUM\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coval.dev/v1/personas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Friendly Spanish Customer\",\n \"persona_prompt\": \"You are a friendly Spanish-speaking customer calling for technical support...\",\n \"voice_name\": \"marina\",\n \"language_code\": \"es-ES\",\n \"background_sound\": \"office\",\n \"wait_seconds\": 0.5,\n \"conversation_initiation\": \"speak_first\",\n \"interruption_rate\": \"MEDIUM\"\n}"
response = http.request(request)
puts response.read_body{
"persona": {
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"resource_name": "personas/3zfmuDbVQsi4GaseDtiVcS",
"id": "3zfmuDbVQsi4GaseDtiVcS",
"name": "Friendly Customer",
"create_time": "2025-01-24T10:00:00Z",
"silent_mode": true,
"multi_phone_config": {
"phone_number_index": 2,
"phone_number_name": "<string>"
},
"initialization_parameters": {},
"custom_persona_data": "<string>",
"voice": "alloy",
"custom_voice_id": "<string>",
"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",
"interruption_rate": "MEDIUM",
"interruption_instructions_enabled": false,
"multi_language_stt": true,
"hold_music_timeout_seconds": 15,
"situate_speaker": "speakerphone-hard",
"audio_degradation": {
"preset": "cell-poor",
"preset_version": 1
},
"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": "INTERNAL",
"message": "An unexpected error occurred"
}
}Create persona
Create a new simulated persona with specified voice characteristics and behavior configuration.
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",
"interruption_rate": "MEDIUM"
}
'import requests
url = "https://api.coval.dev/v1/personas"
payload = {
"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",
"interruption_rate": "MEDIUM"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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',
interruption_rate: 'MEDIUM'
})
};
fetch('https://api.coval.dev/v1/personas', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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',
'interruption_rate' => 'MEDIUM'
]),
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"
payload := strings.NewReader("{\n \"name\": \"Friendly Spanish Customer\",\n \"persona_prompt\": \"You are a friendly Spanish-speaking customer calling for technical support...\",\n \"voice_name\": \"marina\",\n \"language_code\": \"es-ES\",\n \"background_sound\": \"office\",\n \"wait_seconds\": 0.5,\n \"conversation_initiation\": \"speak_first\",\n \"interruption_rate\": \"MEDIUM\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.coval.dev/v1/personas")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Friendly Spanish Customer\",\n \"persona_prompt\": \"You are a friendly Spanish-speaking customer calling for technical support...\",\n \"voice_name\": \"marina\",\n \"language_code\": \"es-ES\",\n \"background_sound\": \"office\",\n \"wait_seconds\": 0.5,\n \"conversation_initiation\": \"speak_first\",\n \"interruption_rate\": \"MEDIUM\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coval.dev/v1/personas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Friendly Spanish Customer\",\n \"persona_prompt\": \"You are a friendly Spanish-speaking customer calling for technical support...\",\n \"voice_name\": \"marina\",\n \"language_code\": \"es-ES\",\n \"background_sound\": \"office\",\n \"wait_seconds\": 0.5,\n \"conversation_initiation\": \"speak_first\",\n \"interruption_rate\": \"MEDIUM\"\n}"
response = http.request(request)
puts response.read_body{
"persona": {
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"resource_name": "personas/3zfmuDbVQsi4GaseDtiVcS",
"id": "3zfmuDbVQsi4GaseDtiVcS",
"name": "Friendly Customer",
"create_time": "2025-01-24T10:00:00Z",
"silent_mode": true,
"multi_phone_config": {
"phone_number_index": 2,
"phone_number_name": "<string>"
},
"initialization_parameters": {},
"custom_persona_data": "<string>",
"voice": "alloy",
"custom_voice_id": "<string>",
"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",
"interruption_rate": "MEDIUM",
"interruption_instructions_enabled": false,
"multi_language_stt": true,
"hold_music_timeout_seconds": 15,
"situate_speaker": "speakerphone-hard",
"audio_degradation": {
"preset": "cell-poor",
"preset_version": 1
},
"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": "INTERNAL",
"message": "An unexpected error occurred"
}
}Headers
Body
Persona-level initialization parameters. Null clears; an empty object replaces existing parameters. String values substitute into the initialization payload as JSON-escaped text (quote the "{{persona.key}}" placeholder); all other JSON values substitute as their JSON encoding.
Additional serialized JSON object sent as the chat request's customPersonaData, overriding the agent-level customPersonaData. Included only when the HTTP text agent does not configure input_template; a template-configured agent shapes its own request and does not receive it. Must parse as a JSON object and stay under 16 KiB. Null clears it.
16383Built-in background sound id, or custom:<background_sound_id> for an active custom sound returned by GET /personas/background-sounds.
100^(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_-]+)$"office"
How often the persona interrupts the agent. While the agent is speaking, the persona forces a new turn once about 90 seconds (LOW), 45 seconds (MEDIUM), or 30 seconds (HIGH) have passed since the call started or since its last interruption. NONE never interrupts. This is a timer, not a semantic barge-in.
NONE, LOW, MEDIUM, HIGH "MEDIUM"
Was this page helpful?