For the complete documentation index, see llms.txt. Any page on this site can be fetched as Markdown by appending .md to its URL.

Voice agentsAgent tests

Draft a test from a conversation

POST
/v1/agent-media/agents/{agentId}/tests/draft-from-conversation

Build an unsaved scripted test from a finished call or chat this agent handled. The draft is deterministic and uses no AI: its turns are what the caller said, each tool is stubbed with the last result it returned, and its checks are that each tool was called and that the conversation ended with its disposition. Nothing is saved; send the test to the create operation to keep it.

A chat's stored history holds only its last 60 messages, so a draft from a long chat starts partway through. truncated is true when the draft was cut to fit the test limits (40 turns, 20 checks, 4000 characters per turn) or to stay under 80 KB, which drops trailing turns first.

Authorization

bearerAuth
AuthorizationBearer <token>

A Tandem bearer token. Requests are scoped to the organization the token belongs to; no organization header is required.

In: header

Path Parameters

agentId*string

The agent's unique ID.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/agent-media/agents/string/tests/draft-from-conversation" \  -H "Content-Type: application/json" \  -d '{    "conversationId": "string"  }'
{  "test": {    "name": "string",    "description": "string",    "mode": "scripted",    "scripted": {      "turns": [        "string"      ]    },    "simulated": {      "persona": "string",      "goal": "string",      "maxTurns": 20    },    "stubs": {},    "checks": [],    "criteria": [],    "repeat": 1,    "caller": {      "ani": "string",      "contact": {        "attributes": {          "property1": "string",          "property2": "string"        }      }    },    "workflowVariables": {      "property1": "string",      "property2": "string"    },    "memory": {      "callCount": 1,      "synopsis": "string",      "rollingSummary": "string",      "openThreads": "string"    }  },  "truncated": true}
{  "error": "string",  "message": "string",  "limit": 0,  "length": 0,  "reason": "string"}
{  "error": "string",  "message": "string",  "limit": 0,  "length": 0,  "reason": "string"}
{  "error": "string",  "message": "string",  "limit": 0,  "length": 0,  "reason": "string"}
{  "error": "string",  "message": "string",  "limit": 0,  "length": 0,  "reason": "string",  "agentId": "string"}