Skip to main content
POST
Create case
A case is the runnable unit of agent eval — persona + agent + scenario + success criteria. Suites are optional; a case with suite_id: null is an ad-hoc case you can run on its own.

Worked example

Assertion shape

Each entry in success_criteria is one assertion with these fields:

Choosing tool_policy

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys.

Body

application/json
name
string
required
Example:

"Yes path — agreement on first ask"

agent_id
string<uuid>
required
persona_id
string<uuid>
required
scenario
string
required
description
string
suite_id
string<uuid> | null
success_criteria
object[]
max_turns
integer
default:20
Required range: 1 <= x <= 100
pass_threshold
number
default:80
Required range: 0 <= x <= 100
agent_overrides
object | null
tool_policy
enum<string>
default:mock
Available options:
mock,
real,
allowlist
tool_allowlist
string[]

Response

Case created

A specific eval scenario — persona + target agent + scenario + success criteria.

id
string<uuid>
required
company_id
string<uuid>
required
agent_id
string<uuid>
required

Agent under test. Full agent record is expanded inline as agent in API responses.

persona_id
string<uuid>
required
name
string
required
Example:

"Yes path — caller agrees on first ask"

scenario
string
required

Free-form one-paragraph framing the persona LLM is given on top of its identity. Describe the situation that prompted the call.

Example:

"The persona is responding to a missed call from your business about their recent inquiry. They have time to talk for 5 minutes."

success_criteria
object[]
required

Array of assertions evaluated after the run completes.

max_turns
integer
default:20
required

Hard cap on conversation turns. Hitting this terminates the run with termination_reason='max_turns'.

Required range: 1 <= x <= 100
pass_threshold
number
default:80
required

Weighted-score threshold (0-100) for pass_fail=true.

Required range: 0 <= x <= 100
tool_policy
enum<string>
default:mock
required

How the agent's tools behave during the run. mock (default): every tool call returns a synthetic success result the worker fabricates from the tool's declared output schema. real: tools fire for real (charges real money, hits real systems). allowlist: tools whose name appears in tool_allowlist fire for real, the rest return mock results.

Available options:
mock,
real,
allowlist
created_at
string<date-time>
required
agent
object
persona
object

Reusable caller archetype consumed by eval cases. The identity_prompt plus behavior_traits shape how the persona LLM responds; the same persona can be reused across many cases.

suite_id
string<uuid> | null

Optional parent suite. When null, the case is ad-hoc — runnable on its own but not part of a regression sweep.

description
string | null
agent_overrides
object | null

Optional per-case overrides applied to the agent's saved config at run time (e.g. a different system_prompt or flow_config for A/B testing). Same shape as the agent record. The agent on disk is never mutated.

tool_allowlist
string[]

Used only when tool_policy='allowlist'. List of tool names (camelCase) that should fire for real.

updated_at
string<date-time>
deleted_at
string<date-time> | null