Add a case to a suite
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.
apiKeyAuthorizationBearer <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.
id*stringThe suite id.
application/json- body
from*stringWhere the case comes from: conversation, call or script.
"conversation""call""script"conversationId?stringThe conversation to copy the contact’s lines from, when from is conversation.
callId?stringThe call to copy the caller’s lines from, when from is call.
turns?array<>The contact’s lines, in order, when from is script.
1 <= items <= 50name?stringA name for the case.
1 <= length <= 120expectations?array<>What the run must reach. Left out: the agent’s goal is met.
items <= 20The case as saved
application/json- response
case*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" }'{ "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 }}