Creates a new guard policy for the specified tenant. The policy scope, name, and decision are required. Requires admin scope.
POST
/
policies
/
create_policy
Create a policy
curl --request POST \
--url https://api.svantic.com/policies/create_policy \
--header 'Content-Type: application/json' \
--data '
{
"tenant_id": "string",
"scope": "tool",
"name": "string",
"decision": "string",
"description": "string",
"match": {
"example_key": "example_value"
},
"reason": "string",
"approvers": [
"string"
],
"evaluator": {
"example_key": "example_value"
},
"priority": 0,
"enabled": true
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
tenant_id: 'string',
scope: 'tool',
name: 'string',
decision: 'string',
description: 'string',
match: {example_key: 'example_value'},
reason: 'string',
approvers: ['string'],
evaluator: {example_key: 'example_value'},
priority: 0,
enabled: true
})
};
fetch('https://api.svantic.com/policies/create_policy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.svantic.com/policies/create_policy"
payload = {
"tenant_id": "string",
"scope": "tool",
"name": "string",
"decision": "string",
"description": "string",
"match": { "example_key": "example_value" },
"reason": "string",
"approvers": ["string"],
"evaluator": { "example_key": "example_value" },
"priority": 0,
"enabled": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.svantic.com/policies/create_policy"
payload := strings.NewReader("{\n \"tenant_id\": \"string\",\n \"scope\": \"tool\",\n \"name\": \"string\",\n \"decision\": \"string\",\n \"description\": \"string\",\n \"match\": {\n \"example_key\": \"example_value\"\n },\n \"reason\": \"string\",\n \"approvers\": [\n \"string\"\n ],\n \"evaluator\": {\n \"example_key\": \"example_value\"\n },\n \"priority\": 0,\n \"enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"policy": {
"policy_id": "string",
"tenant_id": "string",
"scope": "tool",
"name": "string",
"decision": "string",
"description": "string",
"match": {
"example_key": "example_value"
},
"reason": "string",
"approvers": [
"string"
],
"evaluator": {
"example_key": "example_value"
},
"priority": 0,
"enabled": true,
"created_at": "2026-03-31T12:00:00.000Z",
"updated_at": "2026-03-31T12:00:00.000Z"
}
}{
"error": "Invalid request body",
"code": "BAD_REQUEST"
}{
"error": "Invalid or expired token",
"code": "unauthorized"
}{
"error": "JWT does not include the required scope for this operation",
"code": "forbidden"
}{
"error": "Not found",
"code": "NOT_FOUND",
"request_id": "req_01EXAMPLE",
"timestamp": "2026-03-31T12:00:00.000Z"
}{
"error": "Request timeout",
"code": "REQUEST_TIMEOUT"
}{
"error": "Internal server error",
"code": "INTERNAL_ERROR",
"request_id": "req_01EXAMPLE",
"timestamp": "2026-03-31T12:00:00.000Z"
}{
"error": "Bad gateway",
"code": "BAD_GATEWAY"
}{
"error": "Service temporarily unavailable",
"code": "SERVICE_UNAVAILABLE"
}Body
application/json
Response
Policy created.
Show child attributes
Show child attributes
⌘I
Create a policy
curl --request POST \
--url https://api.svantic.com/policies/create_policy \
--header 'Content-Type: application/json' \
--data '
{
"tenant_id": "string",
"scope": "tool",
"name": "string",
"decision": "string",
"description": "string",
"match": {
"example_key": "example_value"
},
"reason": "string",
"approvers": [
"string"
],
"evaluator": {
"example_key": "example_value"
},
"priority": 0,
"enabled": true
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
tenant_id: 'string',
scope: 'tool',
name: 'string',
decision: 'string',
description: 'string',
match: {example_key: 'example_value'},
reason: 'string',
approvers: ['string'],
evaluator: {example_key: 'example_value'},
priority: 0,
enabled: true
})
};
fetch('https://api.svantic.com/policies/create_policy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.svantic.com/policies/create_policy"
payload = {
"tenant_id": "string",
"scope": "tool",
"name": "string",
"decision": "string",
"description": "string",
"match": { "example_key": "example_value" },
"reason": "string",
"approvers": ["string"],
"evaluator": { "example_key": "example_value" },
"priority": 0,
"enabled": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.svantic.com/policies/create_policy"
payload := strings.NewReader("{\n \"tenant_id\": \"string\",\n \"scope\": \"tool\",\n \"name\": \"string\",\n \"decision\": \"string\",\n \"description\": \"string\",\n \"match\": {\n \"example_key\": \"example_value\"\n },\n \"reason\": \"string\",\n \"approvers\": [\n \"string\"\n ],\n \"evaluator\": {\n \"example_key\": \"example_value\"\n },\n \"priority\": 0,\n \"enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"policy": {
"policy_id": "string",
"tenant_id": "string",
"scope": "tool",
"name": "string",
"decision": "string",
"description": "string",
"match": {
"example_key": "example_value"
},
"reason": "string",
"approvers": [
"string"
],
"evaluator": {
"example_key": "example_value"
},
"priority": 0,
"enabled": true,
"created_at": "2026-03-31T12:00:00.000Z",
"updated_at": "2026-03-31T12:00:00.000Z"
}
}{
"error": "Invalid request body",
"code": "BAD_REQUEST"
}{
"error": "Invalid or expired token",
"code": "unauthorized"
}{
"error": "JWT does not include the required scope for this operation",
"code": "forbidden"
}{
"error": "Not found",
"code": "NOT_FOUND",
"request_id": "req_01EXAMPLE",
"timestamp": "2026-03-31T12:00:00.000Z"
}{
"error": "Request timeout",
"code": "REQUEST_TIMEOUT"
}{
"error": "Internal server error",
"code": "INTERNAL_ERROR",
"request_id": "req_01EXAMPLE",
"timestamp": "2026-03-31T12:00:00.000Z"
}{
"error": "Bad gateway",
"code": "BAD_GATEWAY"
}{
"error": "Service temporarily unavailable",
"code": "SERVICE_UNAVAILABLE"
}