Skip to main content
GET
/
rules
List policy rules
curl --request GET \
  --url https://api.onecli.sh/v1/rules \
  --header 'Authorization: Bearer <token>'
[
  {
    "id": "<string>",
    "name": "<string>",
    "hostPattern": "<string>",
    "pathPattern": "<string>",
    "enabled": true,
    "agentId": "<string>",
    "rateLimit": 123,
    "metadata": {},
    "conditions": [
      {
        "target": "body",
        "operator": "contains",
        "value": "<string>",
        "key": "<string>"
      }
    ],
    "createdAt": "2023-11-07T05:31:56Z"
  }
]

Authorizations

Authorization
string
header
required

API key obtained from the dashboard or GET /user/api-key

Response

200 - application/json

List of rules

id
string
name
string
hostPattern
string

Custom rules only; absent on app-permission rules.

pathPattern
string | null

Custom rules only; absent on app-permission rules.

method
enum<string> | null

Custom rules only; absent on app-permission rules.

Available options:
GET,
POST,
PUT,
PATCH,
DELETE,
null
action
enum<string>
Available options:
block,
rate_limit,
manual_approval,
allow
enabled
boolean
agentId
string | null
rateLimit
integer | null
rateLimitWindow
enum<string> | null
Available options:
minute,
hour,
day,
null
scope
enum<string>

Project lists include inherited organization rules; use this to tell them apart.

Available options:
project,
organization
metadata
object | null

Set on rules generated by app permissions (source: app_permission, plus provider and toolId). Null for custom rules.

conditions
object[]
createdAt
string<date-time>