Create scenario from call
Derive a complete test-harness scenario from a real call and save it to the Scenarios library. Given a sessionId (from list_calls), this reads the call's full transcript, including the tool calls the agent made, and drafts ONE 'instruction' scenario: the caller's opening line, a first-person behaviour brief replaying the caller's side of the call, and an expected-outcome prompt derived from what actually happened (the judge reads it). Observed tool calls are noted as context in the brief, never invented as mock data. Use it to turn a notable real call (a bug report, a tricky caller, a regression) into a repeatable test. The scenario is a TEST HARNESS only, it never changes how the agent itself behaves. The call must have at least one caller turn.
Authorization
bearerAuth A personal access token from Settings > API tokens.
In: header
Header Parameters
A key you choose, such as a UUID, that makes this POST safe to retry. Within 24 hours the same key and request answers with the first successful answer and runs nothing, the same key with a different request answers 422 idempotency_key_reused, and a key whose request is still running answers 409 idempotency_key_in_use. A failed request keeps nothing, so the same key runs it again.
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://example.com/operations/create_scenario_from_transcript" \ -H "Content-Type: application/json" \ -d '{ "sessionId": "string", "agent": "string" }'{}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}File run as scenario POST
Turn an eval run into a repeatable scenario and save it to the Scenarios library. Given a runId (from get_test_results), this reads what actually happened on that run, the conversation and the tool calls the agent made, and drafts ONE 'instruction' scenario: the caller's opening line, a first-person behaviour brief, and an expected-outcome prompt the judge reads. Use it when a run surprises you and the behaviour deserves a permanent test: a red you want to keep checking, or a green that only passed by luck. Works for voice and text runs alike. The scenario is a TEST HARNESS only, it never changes how the agent behaves. The run must have at least one caller turn.
Create test profile POST
Create a named test profile, a reusable caller-identity bundle that backs the {{test_profile["…"]}} variables a scenario references (full_name, order_number, suburb, postcode, etc.). Two sections mirror the call-time split: testingAgentVariables are what the simulated CALLER states on the call; mainAgentVariables are handed to the AGENT UNDER TEST at call time. Use this so one scenario can be replayed against different caller/fixture data without rewriting it; attach the returned profileId to scenarios via create_scenario / update_scenario. The profile is workspace-scoped and is TEST-HARNESS data only, it never feeds the agent's own variables or runtime. Names are unique per workspace; a duplicate is rejected.