Skip to main content
PATCH
Partially update ONE guard rule

Authorizations

Authorization
string
header
required

Use a Bearer token to access these API endpoints. Example: "Bearer {your-token}"

Path Parameters

uuid
string<uuid>
required
ruleUuid
string<uuid>
required

Body

application/json

Guard rules let the agent forward or end a conversation when a defined situation arises (compliance, safety, escalation). The runtime AI relies on when_condition and example_phrases to decide whether a customer utterance triggers the guard — rules without those fields filled cannot fire reliably.

name
string | null

Optional short name for the guard rule.

Example:

"Legal complaint escalation"

when_condition
string

Required. Natural-language description of the situation that should trigger this guard. The runtime AI uses this as instructions when classifying customer utterances. Be specific — 'customer is angry' is too vague; 'customer uses profanity or threatens to escalate' is actionable.

Example:

"Customer mentions a legal complaint, lawyer, lawsuit, or threatens to take legal action."

example_phrases
string[]

Customer utterances that should trigger this guard. Provide 3-5 varied phrasings — the runtime AI uses these as positive examples when classifying.

then_action
enum<string>

What the runtime agent does when the guard fires. forward transfers to a human or another agent; end_conversation politely ends the call/chat.

Available options:
forward,
end_conversation
Example:

"forward"

selected_channels
enum<string>[]

Channels where this guard is active. Defaults to phone-only.

Available options:
phone,
instagram,
whatsapp,
facebook_messenger
say_before_forwarding
string | null

Message spoken before the transfer when then_action=forward.

Example:

"I understand this is important — let me connect you with someone who can help."

say_before_end
string | null

Message spoken before ending when then_action=end_conversation.

Example:

"I'm sorry I couldn't help further. Please contact our team directly. Goodbye."

destination_type
enum<string> | null

Where the call is sent when then_action=forward (same semantics as routing rules).

Available options:
extension,
phone,
agent
destination
string | null

Destination value (extension, SIP URI, or E.164 phone) when then_action=forward.

destination_agent_uuid
string<uuid> | null

Target agent UUID when destination_type=agent.

is_active
boolean
Example:

true

is_default
boolean

Marks this guard as a default that auto-applies to new agents in the workspace.

Example:

false

Response

Guard rule updated

data
object