Get decision rules
Returns the rules and instructions for an organization, mailbox, API key, or agent in the current organization.
GET
Returns the rules and instructions for an organization, mailbox, API key, or agent in the current organization. An agent scope holds the rules added by approving its actions with always; they apply on top of the agent's published rules. An unset policy has version 0 and no rules or presets.
apiKeyheader
x-api-key<token>kind*stringValue in
"organization""mailbox""apiKey""agent"id*stringLength
1 <= lengthPolicySnapshot
application/json- response
presets*array<>rules*array<|>instructions?string|nullversion*PolicyVersionRange
0 <= value <= 9007199254740991import { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.policies.getPolicy({
"kind": "organization",
"id": "example"
});Example Response
{
"presets": [
"string"
],
"rules": [
{
"match": {
"kind": "send",
"effect": "read",
"channel": "sms",
"integration": "string",
"tool": "string",
"subject": "agent"
},
"note": "string",
"decide": "run",
"atLeast": null
}
],
"instructions": "string",
"version": 0
}