Skip to main content
POST

Authorizations

Authorization
string
header
required

Pass the API key in the Authorization header, You need to put Token keyword before the API key. e.g. 'Authorization: Token '

Body

application/json
name
string
required

Rule name (1-255 characters), unique in the project.

Required string length: 1 - 255
appliesIn
enum<string>
required

EVERY_TURN: applies on every turn of the call. PER_USER_RESPONSE: applies only when what the caller says matches the rule, found by meaning (the name, instructions and matchingExamples are searched), so the exact words don't matter.

Available options:
EVERY_TURN,
PER_USER_RESPONSE
checksIn
enum<string>
required

Whose words the guardrail checks: the caller's (CALLER_SAYS), the agent's replies (AGENT_SAYS) or both. It decides which keys callerAgentCheck must have.

Available options:
CALLER_SAYS,
AGENT_SAYS,
BOTH
callerAgentCheck
object
required

What to look for and what to do, per side. Send caller for CALLER_SAYS, agent for AGENT_SAYS, both for BOTH, and no other key. On update it replaces the whole object.

instructions
string
required

The instruction added to the model's instructions while the rule applies (1-100,000 characters).

Required string length: 1 - 100000
conditionsMatch
enum<string>
default:ALL

ALL: every condition must hold. ANY: at least one must hold.

Available options:
ALL,
ANY
conditions
object[]

Call variables that must hold for the rule to apply. Empty: applies on every call.

mode
enum<string>
default:MONITOR

MONITOR: records when the guardrail would fire and changes nothing on the call. ENFORCE: acts on the call whenever it fires. Start in MONITOR to see when it would fire.

Available options:
MONITOR,
ENFORCE
matchingExamples
string | null

What a caller might say, in any language, to help the search find this rule. Only allowed with appliesIn: PER_USER_RESPONSE.

Maximum string length: 5000
notes
string | null

Your own notes. Not used on calls.

Maximum string length: 255
severity
enum<string>
default:NORMAL

How important the rule is. CRITICAL rules are placed closest to the model's reply and are flagged first in call review.

Available options:
NORMAL,
HIGH,
CRITICAL

Response

Created

success
boolean
Example:

true

message
string
Example:

"success"

data
object

A check on what the caller or the agent says, with an action when it matches.