Skip to Content

Get decision rules

Returns the rules and instructions for an organization, mailbox, API key, or agent in the current organization.

GET
/v1/policies/{kind}/{id}

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.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

kind*string
Value in"organization""mailbox""apiKey""agent"
id*string
Length1 <= length

Response Body

PolicySnapshot

application/json
  1. response
presets*array<>
rules*array<|>
instructions?string|null
version*PolicyVersion
Range0 <= value <= 9007199254740991
Example Request
import { 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
}

Related documentation