Update a policy
curl --request PATCH \
--url https://api.kordio.io/control/v1/workspaces/{workspace_slug}/policies/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"mode": "blocklist",
"per_transaction_cap_cents": 123,
"velocity_window_seconds": 123,
"velocity_cap_cents": 123,
"approval_threshold_cents": 123,
"monthly_cap_cents": 123,
"counterparty_allowlist": [
"<string>"
],
"imports": [
"<string>"
],
"rules": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rule_name": "<string>",
"action_types": [
"<string>"
],
"allow": [
"<string>"
],
"max_cents": 123,
"window_seconds": 2,
"max_actions": 2,
"above_cents": 123,
"effect": "deny",
"when": {
"all_of": "<array>",
"any_of": "<array>",
"not": "<unknown>",
"field": "metadata.preapproved",
"value": "<unknown>"
}
}
]
}
'import requests
url = "https://api.kordio.io/control/v1/workspaces/{workspace_slug}/policies/{id}"
payload = {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"mode": "blocklist",
"per_transaction_cap_cents": 123,
"velocity_window_seconds": 123,
"velocity_cap_cents": 123,
"approval_threshold_cents": 123,
"monthly_cap_cents": 123,
"counterparty_allowlist": ["<string>"],
"imports": ["<string>"],
"rules": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rule_name": "<string>",
"action_types": ["<string>"],
"allow": ["<string>"],
"max_cents": 123,
"window_seconds": 2,
"max_actions": 2,
"above_cents": 123,
"effect": "deny",
"when": {
"all_of": "<array>",
"any_of": "<array>",
"not": "<unknown>",
"field": "metadata.preapproved",
"value": "<unknown>"
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
status: 'active',
mode: 'blocklist',
per_transaction_cap_cents: 123,
velocity_window_seconds: 123,
velocity_cap_cents: 123,
approval_threshold_cents: 123,
monthly_cap_cents: 123,
counterparty_allowlist: ['<string>'],
imports: ['<string>'],
rules: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
rule_name: '<string>',
action_types: ['<string>'],
allow: ['<string>'],
max_cents: 123,
window_seconds: 2,
max_actions: 2,
above_cents: 123,
effect: 'deny',
when: {
all_of: '<array>',
any_of: '<array>',
not: '<unknown>',
field: 'metadata.preapproved',
value: '<unknown>'
}
}
]
})
};
fetch('https://api.kordio.io/control/v1/workspaces/{workspace_slug}/policies/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kordio.io/control/v1/workspaces/{workspace_slug}/policies/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'status' => 'active',
'mode' => 'blocklist',
'per_transaction_cap_cents' => 123,
'velocity_window_seconds' => 123,
'velocity_cap_cents' => 123,
'approval_threshold_cents' => 123,
'monthly_cap_cents' => 123,
'counterparty_allowlist' => [
'<string>'
],
'imports' => [
'<string>'
],
'rules' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'rule_name' => '<string>',
'action_types' => [
'<string>'
],
'allow' => [
'<string>'
],
'max_cents' => 123,
'window_seconds' => 2,
'max_actions' => 2,
'above_cents' => 123,
'effect' => 'deny',
'when' => [
'all_of' => '<array>',
'any_of' => '<array>',
'not' => '<unknown>',
'field' => 'metadata.preapproved',
'value' => '<unknown>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kordio.io/control/v1/workspaces/{workspace_slug}/policies/{id}"
payload := strings.NewReader("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"status\": \"active\",\n \"mode\": \"blocklist\",\n \"per_transaction_cap_cents\": 123,\n \"velocity_window_seconds\": 123,\n \"velocity_cap_cents\": 123,\n \"approval_threshold_cents\": 123,\n \"monthly_cap_cents\": 123,\n \"counterparty_allowlist\": [\n \"<string>\"\n ],\n \"imports\": [\n \"<string>\"\n ],\n \"rules\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rule_name\": \"<string>\",\n \"action_types\": [\n \"<string>\"\n ],\n \"allow\": [\n \"<string>\"\n ],\n \"max_cents\": 123,\n \"window_seconds\": 2,\n \"max_actions\": 2,\n \"above_cents\": 123,\n \"effect\": \"deny\",\n \"when\": {\n \"all_of\": \"<array>\",\n \"any_of\": \"<array>\",\n \"not\": \"<unknown>\",\n \"field\": \"metadata.preapproved\",\n \"value\": \"<unknown>\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.patch("https://api.kordio.io/control/v1/workspaces/{workspace_slug}/policies/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"status\": \"active\",\n \"mode\": \"blocklist\",\n \"per_transaction_cap_cents\": 123,\n \"velocity_window_seconds\": 123,\n \"velocity_cap_cents\": 123,\n \"approval_threshold_cents\": 123,\n \"monthly_cap_cents\": 123,\n \"counterparty_allowlist\": [\n \"<string>\"\n ],\n \"imports\": [\n \"<string>\"\n ],\n \"rules\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rule_name\": \"<string>\",\n \"action_types\": [\n \"<string>\"\n ],\n \"allow\": [\n \"<string>\"\n ],\n \"max_cents\": 123,\n \"window_seconds\": 2,\n \"max_actions\": 2,\n \"above_cents\": 123,\n \"effect\": \"deny\",\n \"when\": {\n \"all_of\": \"<array>\",\n \"any_of\": \"<array>\",\n \"not\": \"<unknown>\",\n \"field\": \"metadata.preapproved\",\n \"value\": \"<unknown>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kordio.io/control/v1/workspaces/{workspace_slug}/policies/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"status\": \"active\",\n \"mode\": \"blocklist\",\n \"per_transaction_cap_cents\": 123,\n \"velocity_window_seconds\": 123,\n \"velocity_cap_cents\": 123,\n \"approval_threshold_cents\": 123,\n \"monthly_cap_cents\": 123,\n \"counterparty_allowlist\": [\n \"<string>\"\n ],\n \"imports\": [\n \"<string>\"\n ],\n \"rules\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rule_name\": \"<string>\",\n \"action_types\": [\n \"<string>\"\n ],\n \"allow\": [\n \"<string>\"\n ],\n \"max_cents\": 123,\n \"window_seconds\": 2,\n \"max_actions\": 2,\n \"above_cents\": 123,\n \"effect\": \"deny\",\n \"when\": {\n \"all_of\": \"<array>\",\n \"any_of\": \"<array>\",\n \"not\": \"<unknown>\",\n \"field\": \"metadata.preapproved\",\n \"value\": \"<unknown>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"mode": "blocklist",
"per_transaction_cap_cents": 123,
"velocity_window_seconds": 123,
"velocity_cap_cents": 123,
"approval_threshold_cents": 123,
"monthly_cap_cents": 123,
"counterparty_allowlist": [
"<string>"
],
"imports": [
"<string>"
],
"rules": [
{
"kind": "action_allowlist",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rule_name": "<string>",
"action_types": [
"<string>"
],
"allow": [
"<string>"
],
"max_cents": 123,
"window_seconds": 2,
"max_actions": 2,
"above_cents": 123,
"effect": "deny",
"when": {
"all_of": "<array>",
"any_of": "<array>",
"not": "<unknown>",
"field": "metadata.preapproved",
"operator": "eq",
"value": "<unknown>"
}
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"message": "Insufficient role",
"code": "insufficient_role"
}
}{
"error": {
"message": "<string>",
"code": "runtime_key_required"
}
}{
"error": {
"message": "<string>",
"code": "runtime_key_required"
}
}Requires manage_policy.
PATCH
/
control
/
v1
/
workspaces
/
{workspace_slug}
/
policies
/
{id}
Update a policy
curl --request PATCH \
--url https://api.kordio.io/control/v1/workspaces/{workspace_slug}/policies/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"mode": "blocklist",
"per_transaction_cap_cents": 123,
"velocity_window_seconds": 123,
"velocity_cap_cents": 123,
"approval_threshold_cents": 123,
"monthly_cap_cents": 123,
"counterparty_allowlist": [
"<string>"
],
"imports": [
"<string>"
],
"rules": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rule_name": "<string>",
"action_types": [
"<string>"
],
"allow": [
"<string>"
],
"max_cents": 123,
"window_seconds": 2,
"max_actions": 2,
"above_cents": 123,
"effect": "deny",
"when": {
"all_of": "<array>",
"any_of": "<array>",
"not": "<unknown>",
"field": "metadata.preapproved",
"value": "<unknown>"
}
}
]
}
'import requests
url = "https://api.kordio.io/control/v1/workspaces/{workspace_slug}/policies/{id}"
payload = {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"mode": "blocklist",
"per_transaction_cap_cents": 123,
"velocity_window_seconds": 123,
"velocity_cap_cents": 123,
"approval_threshold_cents": 123,
"monthly_cap_cents": 123,
"counterparty_allowlist": ["<string>"],
"imports": ["<string>"],
"rules": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rule_name": "<string>",
"action_types": ["<string>"],
"allow": ["<string>"],
"max_cents": 123,
"window_seconds": 2,
"max_actions": 2,
"above_cents": 123,
"effect": "deny",
"when": {
"all_of": "<array>",
"any_of": "<array>",
"not": "<unknown>",
"field": "metadata.preapproved",
"value": "<unknown>"
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
status: 'active',
mode: 'blocklist',
per_transaction_cap_cents: 123,
velocity_window_seconds: 123,
velocity_cap_cents: 123,
approval_threshold_cents: 123,
monthly_cap_cents: 123,
counterparty_allowlist: ['<string>'],
imports: ['<string>'],
rules: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
rule_name: '<string>',
action_types: ['<string>'],
allow: ['<string>'],
max_cents: 123,
window_seconds: 2,
max_actions: 2,
above_cents: 123,
effect: 'deny',
when: {
all_of: '<array>',
any_of: '<array>',
not: '<unknown>',
field: 'metadata.preapproved',
value: '<unknown>'
}
}
]
})
};
fetch('https://api.kordio.io/control/v1/workspaces/{workspace_slug}/policies/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kordio.io/control/v1/workspaces/{workspace_slug}/policies/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'status' => 'active',
'mode' => 'blocklist',
'per_transaction_cap_cents' => 123,
'velocity_window_seconds' => 123,
'velocity_cap_cents' => 123,
'approval_threshold_cents' => 123,
'monthly_cap_cents' => 123,
'counterparty_allowlist' => [
'<string>'
],
'imports' => [
'<string>'
],
'rules' => [
[
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'rule_name' => '<string>',
'action_types' => [
'<string>'
],
'allow' => [
'<string>'
],
'max_cents' => 123,
'window_seconds' => 2,
'max_actions' => 2,
'above_cents' => 123,
'effect' => 'deny',
'when' => [
'all_of' => '<array>',
'any_of' => '<array>',
'not' => '<unknown>',
'field' => 'metadata.preapproved',
'value' => '<unknown>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kordio.io/control/v1/workspaces/{workspace_slug}/policies/{id}"
payload := strings.NewReader("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"status\": \"active\",\n \"mode\": \"blocklist\",\n \"per_transaction_cap_cents\": 123,\n \"velocity_window_seconds\": 123,\n \"velocity_cap_cents\": 123,\n \"approval_threshold_cents\": 123,\n \"monthly_cap_cents\": 123,\n \"counterparty_allowlist\": [\n \"<string>\"\n ],\n \"imports\": [\n \"<string>\"\n ],\n \"rules\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rule_name\": \"<string>\",\n \"action_types\": [\n \"<string>\"\n ],\n \"allow\": [\n \"<string>\"\n ],\n \"max_cents\": 123,\n \"window_seconds\": 2,\n \"max_actions\": 2,\n \"above_cents\": 123,\n \"effect\": \"deny\",\n \"when\": {\n \"all_of\": \"<array>\",\n \"any_of\": \"<array>\",\n \"not\": \"<unknown>\",\n \"field\": \"metadata.preapproved\",\n \"value\": \"<unknown>\"\n }\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.patch("https://api.kordio.io/control/v1/workspaces/{workspace_slug}/policies/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"status\": \"active\",\n \"mode\": \"blocklist\",\n \"per_transaction_cap_cents\": 123,\n \"velocity_window_seconds\": 123,\n \"velocity_cap_cents\": 123,\n \"approval_threshold_cents\": 123,\n \"monthly_cap_cents\": 123,\n \"counterparty_allowlist\": [\n \"<string>\"\n ],\n \"imports\": [\n \"<string>\"\n ],\n \"rules\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rule_name\": \"<string>\",\n \"action_types\": [\n \"<string>\"\n ],\n \"allow\": [\n \"<string>\"\n ],\n \"max_cents\": 123,\n \"window_seconds\": 2,\n \"max_actions\": 2,\n \"above_cents\": 123,\n \"effect\": \"deny\",\n \"when\": {\n \"all_of\": \"<array>\",\n \"any_of\": \"<array>\",\n \"not\": \"<unknown>\",\n \"field\": \"metadata.preapproved\",\n \"value\": \"<unknown>\"\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kordio.io/control/v1/workspaces/{workspace_slug}/policies/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"status\": \"active\",\n \"mode\": \"blocklist\",\n \"per_transaction_cap_cents\": 123,\n \"velocity_window_seconds\": 123,\n \"velocity_cap_cents\": 123,\n \"approval_threshold_cents\": 123,\n \"monthly_cap_cents\": 123,\n \"counterparty_allowlist\": [\n \"<string>\"\n ],\n \"imports\": [\n \"<string>\"\n ],\n \"rules\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"rule_name\": \"<string>\",\n \"action_types\": [\n \"<string>\"\n ],\n \"allow\": [\n \"<string>\"\n ],\n \"max_cents\": 123,\n \"window_seconds\": 2,\n \"max_actions\": 2,\n \"above_cents\": 123,\n \"effect\": \"deny\",\n \"when\": {\n \"all_of\": \"<array>\",\n \"any_of\": \"<array>\",\n \"not\": \"<unknown>\",\n \"field\": \"metadata.preapproved\",\n \"value\": \"<unknown>\"\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"mode": "blocklist",
"per_transaction_cap_cents": 123,
"velocity_window_seconds": 123,
"velocity_cap_cents": 123,
"approval_threshold_cents": 123,
"monthly_cap_cents": 123,
"counterparty_allowlist": [
"<string>"
],
"imports": [
"<string>"
],
"rules": [
{
"kind": "action_allowlist",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rule_name": "<string>",
"action_types": [
"<string>"
],
"allow": [
"<string>"
],
"max_cents": 123,
"window_seconds": 2,
"max_actions": 2,
"above_cents": 123,
"effect": "deny",
"when": {
"all_of": "<array>",
"any_of": "<array>",
"not": "<unknown>",
"field": "metadata.preapproved",
"operator": "eq",
"value": "<unknown>"
}
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"message": "Insufficient role",
"code": "insufficient_role"
}
}{
"error": {
"message": "<string>",
"code": "runtime_key_required"
}
}{
"error": {
"message": "<string>",
"code": "runtime_key_required"
}
}Authorizations
An identity bearer token for a person or your backend. Capabilities are per member, per workspace. This credential can manage the workspace and can never authorize an action as an agent.
Body
application/json
The policy shape, without an agent binding. Used for previews.
Required on create.
Available options:
active, disabled blocklist permits unless a rule denies. allowlist inverts it: denied unless an allow rule matches, reported as not_allowlisted. Each allowlist policy is an independent gate, so attaching two means both must be satisfied. A deny still overrides an allow.
Available options:
blocklist, allowlist Policy module names. Their rules compile in ahead of rules.
Show child attributes
Show child attributes
Response
The updated policy.
The policy shape, without an agent binding. Used for previews.
Show child attributes
Show child attributes