Update unit test
curl --request PATCH \
--url https://app.freyavoice.ai/api/v2/unit-tests/{unitTestId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"expectation": "<string>",
"assertions": [
{
"type": "routing",
"target": "<string>",
"signal": "node_entered",
"negate": false
}
],
"judgeContext": {
"includeRoutingEvents": true,
"includeExtractionEvents": true,
"includeToolCalls": true,
"includeOtherEvents": true
},
"ordinal": 123,
"isArchived": true,
"tags": [
"<string>"
]
}
'import requests
url = "https://app.freyavoice.ai/api/v2/unit-tests/{unitTestId}"
payload = {
"name": "<string>",
"expectation": "<string>",
"assertions": [
{
"type": "routing",
"target": "<string>",
"signal": "node_entered",
"negate": False
}
],
"judgeContext": {
"includeRoutingEvents": True,
"includeExtractionEvents": True,
"includeToolCalls": True,
"includeOtherEvents": True
},
"ordinal": 123,
"isArchived": True,
"tags": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
expectation: '<string>',
assertions: [{type: 'routing', target: '<string>', signal: 'node_entered', negate: false}],
judgeContext: {
includeRoutingEvents: true,
includeExtractionEvents: true,
includeToolCalls: true,
includeOtherEvents: true
},
ordinal: 123,
isArchived: true,
tags: ['<string>']
})
};
fetch('https://app.freyavoice.ai/api/v2/unit-tests/{unitTestId}', 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/unit-tests/{unitTestId}",
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([
'name' => '<string>',
'expectation' => '<string>',
'assertions' => [
[
'type' => 'routing',
'target' => '<string>',
'signal' => 'node_entered',
'negate' => false
]
],
'judgeContext' => [
'includeRoutingEvents' => true,
'includeExtractionEvents' => true,
'includeToolCalls' => true,
'includeOtherEvents' => true
],
'ordinal' => 123,
'isArchived' => true,
'tags' => [
'<string>'
]
]),
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/unit-tests/{unitTestId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"expectation\": \"<string>\",\n \"assertions\": [\n {\n \"type\": \"routing\",\n \"target\": \"<string>\",\n \"signal\": \"node_entered\",\n \"negate\": false\n }\n ],\n \"judgeContext\": {\n \"includeRoutingEvents\": true,\n \"includeExtractionEvents\": true,\n \"includeToolCalls\": true,\n \"includeOtherEvents\": true\n },\n \"ordinal\": 123,\n \"isArchived\": true,\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.freyavoice.ai/api/v2/unit-tests/{unitTestId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"expectation\": \"<string>\",\n \"assertions\": [\n {\n \"type\": \"routing\",\n \"target\": \"<string>\",\n \"signal\": \"node_entered\",\n \"negate\": false\n }\n ],\n \"judgeContext\": {\n \"includeRoutingEvents\": true,\n \"includeExtractionEvents\": true,\n \"includeToolCalls\": true,\n \"includeOtherEvents\": true\n },\n \"ordinal\": 123,\n \"isArchived\": true,\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.freyavoice.ai/api/v2/unit-tests/{unitTestId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"expectation\": \"<string>\",\n \"assertions\": [\n {\n \"type\": \"routing\",\n \"target\": \"<string>\",\n \"signal\": \"node_entered\",\n \"negate\": false\n }\n ],\n \"judgeContext\": {\n \"includeRoutingEvents\": true,\n \"includeExtractionEvents\": true,\n \"includeToolCalls\": true,\n \"includeOtherEvents\": true\n },\n \"ordinal\": 123,\n \"isArchived\": true,\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"message": "<string>",
"result": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entityType": "agent",
"entityId": "<string>",
"name": "<string>",
"expectation": "<string>",
"assertions": [
{
"type": "routing",
"target": "<string>",
"signal": "node_entered",
"negate": false
}
],
"tags": [
"<string>"
],
"input": {
"schemaVersion": 1,
"callType": "web",
"messages": [
{
"role": "<string>",
"message": "<string>",
"content": "<string>",
"messageId": "<string>",
"nodeId": "<string>",
"secondsFromStart": 123,
"duration": 123,
"timestamp": "<string>",
"endTime": 123,
"wasBlocked": true,
"was_blocked": true,
"blockedContent": "<string>",
"blocked_content": "<string>",
"workflowSnapshot": "<unknown>"
}
],
"customerVariables": {},
"authoredAgainstVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"seedCallId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"seedMessageId": "<string>",
"ordinal": 123,
"isArchived": true,
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "<string>",
"updatedAt": "<string>",
"judgeContext": {
"includeRoutingEvents": true,
"includeExtractionEvents": true,
"includeToolCalls": true,
"includeOtherEvents": true
}
}
}
}{
"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>"
}
}Unit Tests
Update unit test
Updates a unit test’s name, expectation, input snapshot, ordinal, or archived flag.
PATCH
/
unit-tests
/
{unitTestId}
Update unit test
curl --request PATCH \
--url https://app.freyavoice.ai/api/v2/unit-tests/{unitTestId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"expectation": "<string>",
"assertions": [
{
"type": "routing",
"target": "<string>",
"signal": "node_entered",
"negate": false
}
],
"judgeContext": {
"includeRoutingEvents": true,
"includeExtractionEvents": true,
"includeToolCalls": true,
"includeOtherEvents": true
},
"ordinal": 123,
"isArchived": true,
"tags": [
"<string>"
]
}
'import requests
url = "https://app.freyavoice.ai/api/v2/unit-tests/{unitTestId}"
payload = {
"name": "<string>",
"expectation": "<string>",
"assertions": [
{
"type": "routing",
"target": "<string>",
"signal": "node_entered",
"negate": False
}
],
"judgeContext": {
"includeRoutingEvents": True,
"includeExtractionEvents": True,
"includeToolCalls": True,
"includeOtherEvents": True
},
"ordinal": 123,
"isArchived": True,
"tags": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
expectation: '<string>',
assertions: [{type: 'routing', target: '<string>', signal: 'node_entered', negate: false}],
judgeContext: {
includeRoutingEvents: true,
includeExtractionEvents: true,
includeToolCalls: true,
includeOtherEvents: true
},
ordinal: 123,
isArchived: true,
tags: ['<string>']
})
};
fetch('https://app.freyavoice.ai/api/v2/unit-tests/{unitTestId}', 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/unit-tests/{unitTestId}",
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([
'name' => '<string>',
'expectation' => '<string>',
'assertions' => [
[
'type' => 'routing',
'target' => '<string>',
'signal' => 'node_entered',
'negate' => false
]
],
'judgeContext' => [
'includeRoutingEvents' => true,
'includeExtractionEvents' => true,
'includeToolCalls' => true,
'includeOtherEvents' => true
],
'ordinal' => 123,
'isArchived' => true,
'tags' => [
'<string>'
]
]),
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/unit-tests/{unitTestId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"expectation\": \"<string>\",\n \"assertions\": [\n {\n \"type\": \"routing\",\n \"target\": \"<string>\",\n \"signal\": \"node_entered\",\n \"negate\": false\n }\n ],\n \"judgeContext\": {\n \"includeRoutingEvents\": true,\n \"includeExtractionEvents\": true,\n \"includeToolCalls\": true,\n \"includeOtherEvents\": true\n },\n \"ordinal\": 123,\n \"isArchived\": true,\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.freyavoice.ai/api/v2/unit-tests/{unitTestId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"expectation\": \"<string>\",\n \"assertions\": [\n {\n \"type\": \"routing\",\n \"target\": \"<string>\",\n \"signal\": \"node_entered\",\n \"negate\": false\n }\n ],\n \"judgeContext\": {\n \"includeRoutingEvents\": true,\n \"includeExtractionEvents\": true,\n \"includeToolCalls\": true,\n \"includeOtherEvents\": true\n },\n \"ordinal\": 123,\n \"isArchived\": true,\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.freyavoice.ai/api/v2/unit-tests/{unitTestId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"expectation\": \"<string>\",\n \"assertions\": [\n {\n \"type\": \"routing\",\n \"target\": \"<string>\",\n \"signal\": \"node_entered\",\n \"negate\": false\n }\n ],\n \"judgeContext\": {\n \"includeRoutingEvents\": true,\n \"includeExtractionEvents\": true,\n \"includeToolCalls\": true,\n \"includeOtherEvents\": true\n },\n \"ordinal\": 123,\n \"isArchived\": true,\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"message": "<string>",
"result": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"entityType": "agent",
"entityId": "<string>",
"name": "<string>",
"expectation": "<string>",
"assertions": [
{
"type": "routing",
"target": "<string>",
"signal": "node_entered",
"negate": false
}
],
"tags": [
"<string>"
],
"input": {
"schemaVersion": 1,
"callType": "web",
"messages": [
{
"role": "<string>",
"message": "<string>",
"content": "<string>",
"messageId": "<string>",
"nodeId": "<string>",
"secondsFromStart": 123,
"duration": 123,
"timestamp": "<string>",
"endTime": 123,
"wasBlocked": true,
"was_blocked": true,
"blockedContent": "<string>",
"blocked_content": "<string>",
"workflowSnapshot": "<unknown>"
}
],
"customerVariables": {},
"authoredAgainstVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"seedCallId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"seedMessageId": "<string>",
"ordinal": 123,
"isArchived": true,
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "<string>",
"updatedAt": "<string>",
"judgeContext": {
"includeRoutingEvents": true,
"includeExtractionEvents": true,
"includeToolCalls": true,
"includeOtherEvents": true
}
}
}
}{
"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.
Path Parameters
Body
application/json
Required string length:
1 - 180Maximum string length:
50000Maximum array length:
50- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes