Create simulation
curl --request POST \
--url https://app.freyavoice.ai/api/v2/simulations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"selectedPersonaIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"description": "<string>",
"tags": [
"<string>"
],
"mode": "voice",
"assertions": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"customerVariablesMap": {},
"maxConcurrentCalls": 500,
"maxCallDurationSeconds": 1830,
"maxRetries": 5,
"runsPerPersona": 25,
"agentVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.freyavoice.ai/api/v2/simulations"
payload = {
"name": "<string>",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"selectedPersonaIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"description": "<string>",
"tags": ["<string>"],
"mode": "voice",
"assertions": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"customerVariablesMap": {},
"maxConcurrentCalls": 500,
"maxCallDurationSeconds": 1830,
"maxRetries": 5,
"runsPerPersona": 25,
"agentVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
agentId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
selectedPersonaIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
description: '<string>',
tags: ['<string>'],
mode: 'voice',
assertions: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
customerVariablesMap: {},
maxConcurrentCalls: 500,
maxCallDurationSeconds: 1830,
maxRetries: 5,
runsPerPersona: 25,
agentVersionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.freyavoice.ai/api/v2/simulations', 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://app.freyavoice.ai/api/v2/simulations",
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' => '<string>',
'agentId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'selectedPersonaIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'description' => '<string>',
'tags' => [
'<string>'
],
'mode' => 'voice',
'assertions' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'customerVariablesMap' => [
],
'maxConcurrentCalls' => 500,
'maxCallDurationSeconds' => 1830,
'maxRetries' => 5,
'runsPerPersona' => 25,
'agentVersionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.freyavoice.ai/api/v2/simulations"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"selectedPersonaIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"mode\": \"voice\",\n \"assertions\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"customerVariablesMap\": {},\n \"maxConcurrentCalls\": 500,\n \"maxCallDurationSeconds\": 1830,\n \"maxRetries\": 5,\n \"runsPerPersona\": 25,\n \"agentVersionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.freyavoice.ai/api/v2/simulations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"selectedPersonaIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"mode\": \"voice\",\n \"assertions\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"customerVariablesMap\": {},\n \"maxConcurrentCalls\": 500,\n \"maxCallDurationSeconds\": 1830,\n \"maxRetries\": 5,\n \"runsPerPersona\": 25,\n \"agentVersionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.freyavoice.ai/api/v2/simulations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"selectedPersonaIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"mode\": \"voice\",\n \"assertions\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"customerVariablesMap\": {},\n \"maxConcurrentCalls\": 500,\n \"maxCallDurationSeconds\": 1830,\n \"maxRetries\": 5,\n \"runsPerPersona\": 25,\n \"agentVersionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"message": "<string>",
"result": {
"simulation": {
"id": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "draft",
"settings": {
"maxConcurrentCalls": 1,
"maxCallDurationSeconds": 60,
"maxRetries": 3,
"runsPerPersona": 1
},
"createdAt": "<string>",
"updatedAt": "<string>",
"description": "<string>",
"tags": [],
"metrics": {
"totalRuns": 0,
"passedRuns": 0,
"failedRuns": 0,
"averageLatencyMs": null,
"averageDurationSeconds": null,
"agentSpeakingPercent": null
},
"latestPassRate": 0.5,
"createdBy": "<string>",
"updatedBy": "<string>"
}
}
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}Simulations
Create simulation
Creates a new simulation for agent testing.
POST
/
simulations
Create simulation
curl --request POST \
--url https://app.freyavoice.ai/api/v2/simulations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"selectedPersonaIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"description": "<string>",
"tags": [
"<string>"
],
"mode": "voice",
"assertions": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"customerVariablesMap": {},
"maxConcurrentCalls": 500,
"maxCallDurationSeconds": 1830,
"maxRetries": 5,
"runsPerPersona": 25,
"agentVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.freyavoice.ai/api/v2/simulations"
payload = {
"name": "<string>",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"selectedPersonaIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"description": "<string>",
"tags": ["<string>"],
"mode": "voice",
"assertions": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"customerVariablesMap": {},
"maxConcurrentCalls": 500,
"maxCallDurationSeconds": 1830,
"maxRetries": 5,
"runsPerPersona": 25,
"agentVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
agentId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
selectedPersonaIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
description: '<string>',
tags: ['<string>'],
mode: 'voice',
assertions: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
customerVariablesMap: {},
maxConcurrentCalls: 500,
maxCallDurationSeconds: 1830,
maxRetries: 5,
runsPerPersona: 25,
agentVersionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.freyavoice.ai/api/v2/simulations', 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://app.freyavoice.ai/api/v2/simulations",
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' => '<string>',
'agentId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'selectedPersonaIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'description' => '<string>',
'tags' => [
'<string>'
],
'mode' => 'voice',
'assertions' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'customerVariablesMap' => [
],
'maxConcurrentCalls' => 500,
'maxCallDurationSeconds' => 1830,
'maxRetries' => 5,
'runsPerPersona' => 25,
'agentVersionId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.freyavoice.ai/api/v2/simulations"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"selectedPersonaIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"mode\": \"voice\",\n \"assertions\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"customerVariablesMap\": {},\n \"maxConcurrentCalls\": 500,\n \"maxCallDurationSeconds\": 1830,\n \"maxRetries\": 5,\n \"runsPerPersona\": 25,\n \"agentVersionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.freyavoice.ai/api/v2/simulations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"selectedPersonaIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"mode\": \"voice\",\n \"assertions\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"customerVariablesMap\": {},\n \"maxConcurrentCalls\": 500,\n \"maxCallDurationSeconds\": 1830,\n \"maxRetries\": 5,\n \"runsPerPersona\": 25,\n \"agentVersionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.freyavoice.ai/api/v2/simulations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"agentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"selectedPersonaIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"mode\": \"voice\",\n \"assertions\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"customerVariablesMap\": {},\n \"maxConcurrentCalls\": 500,\n \"maxCallDurationSeconds\": 1830,\n \"maxRetries\": 5,\n \"runsPerPersona\": 25,\n \"agentVersionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"message": "<string>",
"result": {
"simulation": {
"id": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "draft",
"settings": {
"maxConcurrentCalls": 1,
"maxCallDurationSeconds": 60,
"maxRetries": 3,
"runsPerPersona": 1
},
"createdAt": "<string>",
"updatedAt": "<string>",
"description": "<string>",
"tags": [],
"metrics": {
"totalRuns": 0,
"passedRuns": 0,
"failedRuns": 0,
"averageLatencyMs": null,
"averageDurationSeconds": null,
"agentSpeakingPercent": null
},
"latestPassRate": 0.5,
"createdBy": "<string>",
"updatedBy": "<string>"
}
}
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}{
"success": false,
"data": {
"message": "<string>",
"result": "<unknown>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Minimum string length:
1Required array length:
1 - 1000 elementsMaximum array length:
50Required string length:
1 - 100Available options:
voice, chat Per-persona variable values for this run, keyed by personaId. Saved as the persona's most-recently-used values for the simulated agent.
Show child attributes
Show child attributes
Required range:
1 <= x <= 1000Required range:
60 <= x <= 3600Required range:
0 <= x <= 10Required range:
1 <= x <= 50Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes