Add a case to a suite

POST
/v1/tests/{id}/cases

Adds a case to a suite. from names where it comes from: a conversation or a call that went wrong (the contact's lines are copied, with personal details hidden; a message that tries to instruct the agent is kept so the test can see how the agent copes), or a script of your own. Without expectations the case expects the agent's goal to be met.

Requires an API key with the workspace:write scope.

Authorization

apiKey
headerAuthorizationBearer <token>

A secret API key from the dashboard (Developers → API keys): vl_live_…, or vl_test_… for test mode. Each operation says which scope the key needs.

Path Parameters

id*string

The suite id.

Request Body

application/json
  1. body
from*string

Where the case comes from: conversation, call or script.

Value in"conversation""call""script"
conversationId?string

The conversation to copy the contact’s lines from, when from is conversation.

callId?string

The call to copy the caller’s lines from, when from is call.

turns?array<>

The contact’s lines, in order, when from is script.

Items1 <= items <= 50
name?string

A name for the case.

Length1 <= length <= 120
expectations?array<>

What the run must reach. Left out: the agent’s goal is met.

Itemsitems <= 20

Response Body

The case as saved

application/json
  1. response
case*
Example Request
curl -X POST "https://api.vlayers.ai/v1/tests/$SUITE_ID/cases" \  -H "Authorization: Bearer $VOICELAYER_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "from": "script",    "turns": [      "Hi, I want a refund",      "It arrived broken"    ],    "name": "Refund request"  }'
Example Response
{  "case": {    "id": "0192f5f9-d2e1-7c3f-9e8f-90123456789a",    "suiteId": "0192f5f8-c1d0-7b2e-8d7e-8f9012345678",    "agentId": "0192f5c2-6f7a-7b9c-8d1e-2f3a4b5c6d78",    "name": "Refund went wrong",    "inputKind": "replay",    "turns": [      "I was charged twice",      "Yes, the card ending 4242"    ],    "sourceCallId": null,    "sourceConversationId": "0192f5b0-7c3e-7a51-9b2d-4e8f1a6c3d21",    "expectations": [      {        "evaluationId": "0192f5f7-b0cf-7a1d-9c6d-7e8f90123456",        "expect": {          "bool": true        }      }    ],    "createdBy": "user_2abc",    "createdAt": "2026-10-20T15:04:05.000Z",    "expiresAt": null  }}