Skip to main content
PATCH

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 '

Path Parameters

guardrailId
string<uuid>
required

ID of the guardrail.

Example:

"6e2b9c41-7d3a-4f58-9b12-c4d5e6f70812"

Body

application/json

Send at least one field. Fields you leave out keep their value. checksIn and callerAgentCheck must still agree after the change.

name
string

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

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

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
conditionsMatch
enum<string>

ALL: every condition must hold. ANY: at least one must hold. Omitted: keeps the saved value.

Available options:
ALL,
ANY
conditions
object[]

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

checksIn
enum<string>

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

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.

mode
enum<string>

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. Omitted: keeps the saved value.

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
instructions
string

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

Required string length: 1 - 100000
notes
string | null

Your own notes. Not used on calls.

Maximum string length: 255
severity
enum<string>

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

Available options:
NORMAL,
HIGH,
CRITICAL

Response

Successful response

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.