Skip to Content

Clear decision rules

Clears this scope's rules and instructions only when ifVersion matches, and returns the next version.

DELETE
/v1/policies/{kind}/{id}

Clears this scope's rules and instructions only when ifVersion matches, and returns the next version. The stored version is retained. Other scopes and subject defaults continue to apply.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

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

Query Parameters

ifVersion*integer
Range0 <= value <= 9007199254740991

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.deletePolicy({
  "kind": "organization",
  "id": "example",
  "ifVersion": 0
});
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