Operations
Operations

Test evaluation trigger

Preview whether a metric's evaluation trigger would FIRE on a sample transcript, without running or saving anything. A metric's trigger gates when it runs: 'always' (the default, always fires) or 'custom' (a natural-language condition). For a custom condition this runs the SAME cheap yes/no judge the runtime uses at call time, so the preview matches what the engine would do. Use this to check a custom trigger before relying on it. Returns wouldFire (true/false), the trigger mode, and a plain-English explanation. The metric must be in the current workspace.

POST
/operations/test_evaluation_trigger

Authorization

bearerAuth
AuthorizationBearer <token>

A personal access token from Settings > API tokens.

In: header

Header Parameters

Idempotency-Key?string

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.

Length1 <= length <= 255

Request 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/test_evaluation_trigger" \  -H "Content-Type: application/json" \  -d '{    "metricId": "string",    "transcript": "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
}

Test agent response guardrails POST

Run a transcript through the agent's response guardrails, the same check calls and chat make on each reply, and see which replies go out, which are blocked, and which break a guardrail and are regenerated. Put each line on its own line: a line that starts with 'Agent:' is a reply the agent wrote, and every other line is the caller. An 'Agent:' line before the caller's first line is what the agent last said and is not checked. Each later agent line reports action (speak, block, regenerate or fallback), reason (rule, inactive, error or timeout), the broken guardrail ids, the note the model would get when a reply is regenerated, every question's probability against its threshold, and how long the check took in ms. As on a call, a reply that goes out or is blocked starts a fresh caller turn for the next caller line, and a regenerated reply leaves the caller's words in it. With context tools set, pass contextResults with a realistic result for each one, or every reply reads inactive. jobContext replaces the saved static text for this test, and settings lays unsaved changes over the saved ones. Nothing is saved, no audio plays, no model runs and no tools run. Tests the current version unless versionId names another. configured false means this environment has no classifier key, so its calls are not checked either.

Test guardrails POST

Test the selected agent version using the same checks as live calls and chat. Supply a callerText, a candidate replyText, or both. Optional settings are a partial override for this test only and do not save anything. The result identifies content detections, check errors and measured durations. A caught reply uses the approved safe response unless the action is observe, which records detections without blocking. Conversation guidance reports an effect on a later reply, not a block. Business rules are tested with test_agent_response_guardrails. Each check is billed at its normal usage cost; no audio is played and no tools run.