Running using Voice Calls

Run multiple evaluators at once and receive their execution details.

API Endpont

MethodEndpoint
POSThttps://new-prod.vocera.ai/test_framework/v1/scenarios-external/run_scenarios/

Authentication

Include your API key in the request headers:

HeaderDescription
X-VOCERA-API-KEYYour API key obtained from the dashboard

Request Parameters

ParameterTypeRequiredDescription
agent_idintegerYes*Unique identifier of the agent
assistant_idintegerYes*The assistant ID associated with agent
scenariosarray|string|integerYesArray of evaluator IDs to run OR "all" to run all OR number to run first N evaluators. Either scenarios or tags must be provided.
tagsarray[string]YesList of tags to filter scenarios to run. Either scenarios or tags must be provided.
freqintegerNoNumber of times to run each scenario (default: 1)
namestringNoLabel text for the result

* Required only when scenarios is "all" OR is number of first N evaluators. Only either of agent_id or assistant_id is required

Example Request Body

Running evaluators using ids

{

    "scenarios": [201, 187],

    "freq": 5,

    "name": "label text" // optional

}
{

    "tags": ["short", "long"],

    "freq": 5,

    "name": "label text" // optional

}

Running all evaluators

{

    "agent_id": 1,

    "scenarios": "all",

    "freq": 5

}

Running first N evaluators

{

    "agent_id": 1,

    "scenarios": 10,

    "freq": 5

}

Response

A successful request returns details about created result.

Response Fields

FieldTypeDescription
idintegerThe result ID
agentintegerID of associated agent
statusstringStatus of the result, can be one of:
running - Initial state when evaluator starts
in_progress - Call is currently executing
completed - Call has finished successfully
failed - Call encountered an error
pending - Testing agent is waiting to be called
success_ratefloatPercentage of runs that passed
run_as_textbooleanIf executed as text (llm websocket) or not
runsarrayList of individual scenario runs
created_atstringISO 8601 timestamp of when the result was created

Run Fields

Each object in the runs array contains:

FieldTypeDescription
idintegerUnique identifier for the individual run
scenariointegerID of the scenario being run
numberstring|nullPhone number assigned to the run if outbound call

Example Response

{

    "id": 167,

    "agent": 1,

    "status": "pending",

    "success_rate": 0.0,

    "run_as_text": false,

    "runs": [

        {

            "id": 274,

            "scenario": 1,

            "number": "+11234567890"

        },

        {

            "id": 273,

            "scenario": 2,

            "number": "+11234567890"

        }

    ],

    "created_at": "2025-02-25T21:00:01.990052Z"

}

Code Examples

# Running using evaluator IDs

curl -X POST https://new-prod.vocera.ai/test_framework/v1/scenarios-external/run_scenarios/ \

  -H "X-VOCERA-API-KEY: <your-api-key-here>" \

  -H "Content-Type: application/json" \

  -d '{

      "scenarios": [<evaluator-id-1>, <evaluator-id-2>, ...],

      "freq": 1

    }'



# Running all evaluators

curl -X POST https://new-prod.vocera.ai/test_framework/v1/scenarios-external/run_scenarios/ \

  -H "X-VOCERA-API-KEY: <your-api-key-here>" \

  -H "Content-Type: application/json" \

  -d '{

    "scenarios": "all",

    "agent_id": <agent-id>,

    "freq": 1

  }'



# Running first N evaluators

curl -X POST https://new-prod.vocera.ai/test_framework/v1/scenarios-external/run_scenarios/ \

  -H "X-VOCERA-API-KEY: <your-api-key-here>" \

  -H "Content-Type: application/json" \

  -d '{

    "scenarios": <number-of-evaluators>,

    "agent_id": <agent-id>,

    "freq": 1

  }'

Running using LLM Websocket

Run multiple evaluators at once using your LLM websocket and receive their execution details.

You need to add the url to your LLM websocket in your agent at Vocera. For demo websocket server you can use wss://echo.websocket.org or install using this repo.

MethodEndpoint
POSThttps://new-prod.vocera.ai/test_framework/v1/scenarios-external/run_scenarios_text/

Authentication

Include your API key in the request headers:

HeaderDescription
X-VOCERA-API-KEYYour API key obtained from the dashboard

Request Parameters

ParameterTypeRequiredDescription
agent_idintegerYes*Unique identifier of the agent
assistant_idstringYes*The assistant ID associated with agent
scenariosarray|string|integerYesArray of evaluator IDs to run OR "all" to run all OR number to run first N evaluators
freqintegerNoNumber of times to run each scenario (default: 1)

* Required only when scenarios is "all" OR is number of first N evaluators. Only either of agent_id or assistant_id is required

Example Request Body

Running evaluators using ids

{

    "scenarios": [201, 187],

    "freq": 5

}

Running all evaluators

{

    "agent_id": 1,

    "scenarios": "all",

    "freq": 5

}

Running first N evaluators

{

    "agent_id": 1,

    "scenarios": 10,

    "freq": 5

}

Response

A successful request returns details about the running evaluators.

Response Fields

FieldTypeDescription
idintegerThe result ID
agentintegerID of associated agent
statusstringStatus of the result, can be one of:
running - Initial state when evaluator starts
in_progress - Call is currently executing
completed - Call has finished successfully
failed - Call encountered an error
pending - Testing agent is waiting to be called
success_ratefloatPercentage of runs that passed
run_as_textbooleanIf executed as text (llm websocket) or not
runsarrayList of individual scenario runs
created_atstringISO 8601 timestamp of when the result was created

Run Fields

Each object in the runs array contains:

FieldTypeDescription
idintegerUnique identifier for the individual run
scenariointegerID of the scenario being run
numberinteger|nullSequential number of the run (when freq > 1)

Example Response

{

    "id": 167,

    "agent": 1,

    "status": "running",

    "success_rate": 0.0,

    "run_as_text": false,

    "runs": [

        {

            "id": 274,

            "scenario": 1,

            "number": null

        },

        {

            "id": 273,

            "scenario": 2,

            "number": null

        }

    ],

    "created_at": "2025-02-25T21:00:01.990052Z"

}

WebSocket Message Format

Messages exchanged through the LLM WebSocket connection follow two main formats: normal messages and function calls.

Message Types

Normal Messages

Simple text messages exchanged between the client and server.

FieldTypeDescription
contentstringThe text message content
{

  "content": "Hello! How can I help you today?"

}

Function Messages

Messages related to function execution, including both calls and results.

FieldTypeDescription
rolestringMessage type: Function Call or Function Call Result
dataobjectFunction-specific information (see below)

Function Call Data Fields:

FieldTypeDescription
idstringUnique identifier for the function call
namestringName of the function being called
argumentsstringJSON-encoded function arguments

Function Result Data Fields:

FieldTypeDescription
idstringMatching identifier from the function call
namestringName of the executed function
resultstringFunction execution result or error message

Examples

Function Call:

{

    "role": "Function Call",

    "data": {

        "id": "call_5otWH44dxeXEHY8RlhYYaFbV",

        "name": "bookUserAppointment",

        "arguments": "{\"name\": \"John\", \"datetime\": \"2024-10-17T18:00:00\"}"

    }

}

Function Result:

{

    "role": "Function Call Result",

    "data": {

        "id": "call_5otWH44dxeXEHY8RlhYYaFbV",

        "name": "bookUserAppointment",

        "result": "Appointment successfully booked"

    }

}

Code Examples

# Running using evaluator IDs

curl -X POST https://new-prod.vocera.ai/test_framework/v1/scenarios-external/run_scenarios_text/ \

  -H "X-VOCERA-API-KEY: <your-api-key-here>" \

  -H "Content-Type: application/json" \

  -d '{

      "scenarios": [<evaluator-id-1>, <evaluator-id-2>, ...],

      "freq": 1

    }'



# Running all evaluators

curl -X POST https://new-prod.vocera.ai/test_framework/v1/scenarios-external/run_scenarios_text/ \

  -H "X-VOCERA-API-KEY: <your-api-key-here>" \

  -H "Content-Type: application/json" \

  -d '{

    "scenarios": "all",

    "agent_id": <agent-id>,

    "freq": 1

  }'



# Running first N evaluators

curl -X POST https://new-prod.vocera.ai/test_framework/v1/scenarios-external/run_scenarios_text/ \

  -H "X-VOCERA-API-KEY: <your-api-key-here>" \

  -H "Content-Type: application/json" \

  -d '{

    "scenarios": <number-of-evaluators>,

    "agent_id": <agent-id>,

    "freq": 1

  }'