curl --request PATCH \
--url https://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/guardrails/{guardrailId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"isActive": false
}
'{
"success": true,
"message": "success",
"data": [
{
"id": "6e2b9c41-7d3a-4f58-9b12-c4d5e6f70812",
"projectId": "fbb9e8b2-2dbb-40f9-a051-9404624e3247",
"userId": "b7d9e979-4a16-437b-8571-4ed92a94faa8",
"createdBy": "b7d9e979-4a16-437b-8571-4ed92a94faa8",
"name": "No passwords",
"appliesIn": "EVERY_TURN",
"conditionsMatch": "ALL",
"conditions": [
{
"variable": "channel",
"condition": "is_not",
"value": "internal"
}
],
"checksIn": "CALLER_SAYS",
"callerAgentCheck": {
"caller": {
"lookFor": "PATTERN",
"lookForValue": "\\b(password|pin)\\b",
"behaviour": "MESSAGE",
"behaviourValue": "I can't take passwords over the phone."
}
},
"mode": "ENFORCE",
"matchingExamples": null,
"instructions": "Never ask for or repeat a password or PIN.",
"notes": null,
"severity": "CRITICAL",
"status": null,
"failureReason": null,
"createdAt": "2026-10-20T09:15:00.000Z",
"updatedAt": "2026-10-20T09:15:00.000Z",
"isActive": true
}
]
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}Guardrails
Toggle Agent Guardrail
Turns one assigned guardrail on or off for this agent, without removing it. The change is saved in your own draft, like Update Voice Agent: a test call of the draft uses it, and callers get it when the draft is published. Only active ones reach calls. Editing a guardrail itself still applies to every agent right away.
PATCH
/
v2
/
voice-agents
/
{voiceAgentId}
/
guardrails
/
{guardrailId}
curl --request PATCH \
--url https://api.tryhamsa.com/v2/voice-agents/{voiceAgentId}/guardrails/{guardrailId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"isActive": false
}
'{
"success": true,
"message": "success",
"data": [
{
"id": "6e2b9c41-7d3a-4f58-9b12-c4d5e6f70812",
"projectId": "fbb9e8b2-2dbb-40f9-a051-9404624e3247",
"userId": "b7d9e979-4a16-437b-8571-4ed92a94faa8",
"createdBy": "b7d9e979-4a16-437b-8571-4ed92a94faa8",
"name": "No passwords",
"appliesIn": "EVERY_TURN",
"conditionsMatch": "ALL",
"conditions": [
{
"variable": "channel",
"condition": "is_not",
"value": "internal"
}
],
"checksIn": "CALLER_SAYS",
"callerAgentCheck": {
"caller": {
"lookFor": "PATTERN",
"lookForValue": "\\b(password|pin)\\b",
"behaviour": "MESSAGE",
"behaviourValue": "I can't take passwords over the phone."
}
},
"mode": "ENFORCE",
"matchingExamples": null,
"instructions": "Never ask for or repeat a password or PIN.",
"notes": null,
"severity": "CRITICAL",
"status": null,
"failureReason": null,
"createdAt": "2026-10-20T09:15:00.000Z",
"updatedAt": "2026-10-20T09:15:00.000Z",
"isActive": true
}
]
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}{
"code": 8404,
"message": "Policy not found!",
"messageKey": "PolicyNotFound",
"params": {
"reason": "NO_DRAFT"
}
}Authorizations
Path Parameters
Was this page helpful?