Skip to main content
POST
/
org
/
rules
Create an organization rule
curl --request POST \
  --url https://api.onecli.sh/v1/org/rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "hostPattern": "<string>",
  "enabled": true,
  "pathPattern": "<string>",
  "rateLimit": 2,
  "conditions": [
    {
      "target": "<string>",
      "operator": "<string>",
      "value": "<string>",
      "key": "<string>"
    }
  ]
}
'
{
  "id": "<string>",
  "name": "<string>",
  "hostPattern": "<string>",
  "pathPattern": "<string>",
  "enabled": true,
  "agentId": "<string>",
  "rateLimit": 123,
  "scope": "<string>",
  "metadata": {},
  "conditions": [
    {
      "target": "<string>",
      "operator": "<string>",
      "value": "<string>",
      "key": "<string>"
    }
  ],
  "createdAt": "2023-11-07T05:31:56Z"
}

Documentation Index

Fetch the complete documentation index at: https://onecli.sh/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

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

Body

application/json
name
string
required
Required string length: 1 - 255
hostPattern
string
required
action
enum<string>
required
Available options:
block,
rate_limit,
manual_approval
enabled
boolean
required
pathPattern
string
method
enum<string>
Available options:
GET,
POST,
PUT,
PATCH,
DELETE
rateLimit
integer
Required range: x >= 1
rateLimitWindow
enum<string>
Available options:
minute,
hour,
day
conditions
object[]

Response

Rule created

id
string
name
string
hostPattern
string
pathPattern
string | null
method
enum<string> | null
Available options:
GET,
POST,
PUT,
PATCH,
DELETE,
null
action
enum<string>
Available options:
block,
rate_limit,
manual_approval
enabled
boolean
agentId
string | null
rateLimit
integer | null
rateLimitWindow
enum<string> | null
Available options:
minute,
hour,
day,
null
scope
string
metadata
object
conditions
object[]
createdAt
string<date-time>