Skip to main content
PATCH
/
v1
/
policies
/
{id}
curl -X PATCH https://api.raily.ai/v1/policies/pol_xyz789 \
  -H "Authorization: Bearer raily_sk_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "rules": [
      {
        "action": "allow",
        "priority": 1,
        "conditions": { "licenseType": ["enterprise", "professional"] },
        "permissions": ["full_access"]
      }
    ]
  }'
{
  "id": "pol_xyz789",
  "object": "policy",
  "name": "Enterprise Access",
  "rules": [
    {
      "action": "allow",
      "priority": 1,
      "conditions": { "licenseType": ["enterprise", "professional"] },
      "permissions": ["full_access"]
    }
  ],
  "version": 2,
  "created": "2024-01-15T10:30:00Z",
  "updated": "2024-01-16T14:00:00Z"
}

Path Parameters

id
string
required
The policy ID (e.g., pol_abc123)

Request Body

name
string
Updated policy name
description
string
Updated description
rules
array
Updated rules array (replaces existing rules)
defaultAction
string
Default action: allow or deny
Policy updates create a new version. Previous versions are retained for rollback.
curl -X PATCH https://api.raily.ai/v1/policies/pol_xyz789 \
  -H "Authorization: Bearer raily_sk_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "rules": [
      {
        "action": "allow",
        "priority": 1,
        "conditions": { "licenseType": ["enterprise", "professional"] },
        "permissions": ["full_access"]
      }
    ]
  }'
{
  "id": "pol_xyz789",
  "object": "policy",
  "name": "Enterprise Access",
  "rules": [
    {
      "action": "allow",
      "priority": 1,
      "conditions": { "licenseType": ["enterprise", "professional"] },
      "permissions": ["full_access"]
    }
  ],
  "version": 2,
  "created": "2024-01-15T10:30:00Z",
  "updated": "2024-01-16T14:00:00Z"
}