Gate API
POST /gate/check
Execute a gate check before AI action.
Request
bash
curl -X POST https://sovrapp.com/api/sovr/gate/check \
-H "Content-Type: application/json" \
-H "x-api-key: sk_..." \
-H "x-tenant-id: tenant_123" \
-d '{
"tenantId": "tenant_123",
"action": "send_email",
"context": {
"recipient": "client@example.com",
"subject": "Invoice #1234"
}
}'Parameters
| Field | Type | Required | Description |
|---|---|---|---|
tenantId | string | Yes | Tenant identifier |
action | string | Yes | Action type |
context | object | No | Additional context |
plan | object | No | Pre-computed plan |
Response
json
{
"success": true,
"data": {
"decision": "allow",
"reason": "Action matches approved pattern",
"riskScore": 15,
"plan": {
"action": "send_email",
"validated": true
}
}
}Decision Values
| Decision | Description |
|---|---|
allow | Safe to execute |
deny | Blocked |
require_approval | Needs human approval |
POST /gate/risk
Risk assessment only (no decision).
Request
bash
curl -X POST https://sovrapp.com/api/sovr/gate/risk \
-H "Content-Type: application/json" \
-H "x-api-key: sk_..." \
-H "x-tenant-id: tenant_123" \
-d '{
"action": "transfer_funds",
"context": { "amount": 50000 }
}'Response
json
{
"success": true,
"data": {
"score": 72,
"factors": [
{ "name": "amount", "weight": 0.4, "contribution": 32 },
{ "name": "action_type", "weight": 0.3, "contribution": 24 }
]
}
}