Test guardrails
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.
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/test_guardrails" \ -H "Content-Type: application/json" \ -d '{ "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 evaluation trigger POST
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.
Test workflow function POST
Run one workflow function now and return what it did, with secrets masked. Pass `name` for a saved function, or `function` to run a new or edited one before it is saved; either way it uses this version's variables and secrets. This sends a real request: an http function calls its endpoint and retries as its maxRetries says, so a POST that fails with a 5xx or times out can reach the receiving system more than once; an sms function sends a real text (to smsTo when given), email and slack functions deliver for real, and an app function runs its action on the connected account. Pass `preview: true` to render an http, sms, email or slack function without sending anything; tool and app functions cannot be previewed. Testing an app function for real needs workspace-admin access, and connects the app to the agent for the workflow only, as saving it does. Pass sample values for its placeholders in `variables`, at most 64 of 2000 characters each. The run stops at its slot's limit (10 s for callEnded, 90 s otherwise). The reply has status and reason (empty:<token> means that placeholder rendered empty), arguments (the request or message), response, statusCode, elapsedMs, attempts (one entry per try with its status code, reason and ms), conditions (whether the function's `when` would let it run with these values, rule by rule; null when it has none; the test runs either way), outputs (the variables it maps from the response, which later functions read), empty (each field a placeholder left empty, such as query.phone; an empty query or header value is left out of the request) and preview. Nothing is recorded against a call. Use when the operator asks to test, try or preview a pre-call, hang-up or post-call function.