Skip to main content
POST
/
unit-tests
Create unit test
curl --request POST \
  --url https://app.freyavoice.ai/api/v2/unit-tests \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "entityId": "<string>",
  "expectation": "<string>",
  "input": {
    "schemaVersion": 1,
    "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"
  },
  "name": "<string>",
  "seedCallId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "seedMessageId": "<string>"
}
'
{
  "success": true,
  "data": {
    "message": "<string>",
    "result": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "entityId": "<string>",
      "name": "<string>",
      "expectation": "<string>",
      "input": {
        "schemaVersion": 1,
        "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>"
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
workspaceId
string<uuid>
required
entityType
enum<string>
required
Available options:
agent,
workflow
entityId
string
required
Minimum string length: 1
expectation
string
required
Required string length: 1 - 50000
input
object
required
name
string
Required string length: 1 - 180
seedCallId
string<uuid>
seedMessageId
string

Response

Unit test created

success
enum<boolean>
required
Available options:
true
data
object
required