curl --request GET \
--url https://api.onecli.sh/v1/org/policy/default \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onecli.sh/v1/org/policy/default"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onecli.sh/v1/org/policy/default', 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.onecli.sh/v1/org/policy/default",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onecli.sh/v1/org/policy/default"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.onecli.sh/v1/org/policy/default")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onecli.sh/v1/org/policy/default")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"scope": "project",
"status": "draft",
"generation": 123,
"priority": 123,
"enabled": true,
"isDefault": true,
"logicalId": "<string>",
"source": "<string>",
"name": "<string>",
"description": "<string>",
"action": "allow",
"rateLimit": 123,
"rateLimitWindow": "minute",
"requireApproval": true,
"conditions": "<unknown>",
"identities": [
{
"type": "agent",
"id": "<string>"
}
],
"targets": [
{
"kind": "app",
"provider": "<string>",
"tools": [
"<string>"
],
"connectionScope": "organization",
"connectionId": "<string>",
"secretId": "<string>",
"secretScope": "organization",
"hostPattern": "<string>",
"pathPattern": "<string>",
"method": "GET"
}
],
"createdAt": "2023-11-07T05:31:56Z"
}Get the Default Rule (organization)
The scope’s terminal Default Rule. A virtual default is returned when none is persisted yet; it reflects the baseline posture, not necessarily an enforced snapshot.
curl --request GET \
--url https://api.onecli.sh/v1/org/policy/default \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onecli.sh/v1/org/policy/default"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onecli.sh/v1/org/policy/default', 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.onecli.sh/v1/org/policy/default",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onecli.sh/v1/org/policy/default"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.onecli.sh/v1/org/policy/default")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onecli.sh/v1/org/policy/default")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"scope": "project",
"status": "draft",
"generation": 123,
"priority": 123,
"enabled": true,
"isDefault": true,
"logicalId": "<string>",
"source": "<string>",
"name": "<string>",
"description": "<string>",
"action": "allow",
"rateLimit": 123,
"rateLimitWindow": "minute",
"requireApproval": true,
"conditions": "<unknown>",
"identities": [
{
"type": "agent",
"id": "<string>"
}
],
"targets": [
{
"kind": "app",
"provider": "<string>",
"tools": [
"<string>"
],
"connectionScope": "organization",
"connectionId": "<string>",
"secretId": "<string>",
"secretScope": "organization",
"hostPattern": "<string>",
"pathPattern": "<string>",
"method": "GET"
}
],
"createdAt": "2023-11-07T05:31:56Z"
}Authorizations
API key obtained from the dashboard or GET /user/api-key
Query Parameters
draft, published Response
The Default Rule
A policy-engine rule (the staged draft → publish model). Writes land in the draft; only a publish makes them enforced. Published row ids regenerate on every publish; logicalId is the identity stable across statuses and generations.
project, organization draft, published 0 for the draft working copy; the snapshot number for published rows.
First-match order (lower evaluates first).
True on the scope's terminal Default Rule.
Generation-stable identity; compare rules across draft/published by this, never by id.
custom (user-owned, editable), default (the Default Rule), or system-managed rows: blocklist (compiled from app blocklists) and — at project scope — grant (compiled from agent grants; managed through the Grants endpoints, never edited as rules). Older deployments may also carry legacy app_permission/equipment rows.
allow, block minute, hour, day, null A conditions array, a session-policy object ({repositories} / {folders}), or null.
Show child attributes
Show child attributes
Show child attributes
Show child attributes