Skip to main content

Update a policy

Update a policy’s name or configuration. This is a partial update (PATCH) operation, so you only need to include the fields you want to change.

Endpoint

PATCH /policies/{policy_id}

Authentication

Requires tenant authentication via the X-Tenant-ID header or similar tenant identification mechanism.

Path parameters

policy_id
string
required
UUID of the policy to update

Request body

All fields are optional. Include only the fields you want to update.
name
string
New name for the policy
configuration
object
Partial configuration object to merge with existing configuration. Only include the fields you want to change.

Response

Returns the updated policy with all fields.
id
string
Unique identifier (UUID) of the policy
name
string
Policy name
policy_type
string
Policy type name
configuration
object
Complete policy configuration object after the update
endpoint_id
string
UUID of the endpoint this policy is attached to
created_at
string
Creation timestamp in ISO 8601 format
updated_at
string
Last update timestamp in ISO 8601 format

Example request

Update only the rate limit value:
curl -X PATCH https://api.syftspace.example/policies/987fcdeb-51a2-43d7-8901-abcdef123456 \
  -H "Content-Type: application/json" \
  -H "X-Tenant-ID: your-tenant-id" \
  -d '{
    "configuration": {
      "limit": "200/m"
    }
  }'
Update the policy name:
curl -X PATCH https://api.syftspace.example/policies/987fcdeb-51a2-43d7-8901-abcdef123456 \
  -H "Content-Type: application/json" \
  -H "X-Tenant-ID: your-tenant-id" \
  -d '{
    "name": "Rate limit 200/min"
  }'

Example response

{
  "id": "987fcdeb-51a2-43d7-8901-abcdef123456",
  "name": "Rate limit 200/min",
  "policy_type": "rate_limit",
  "configuration": {
    "limit": "200/m",
    "scope": "per_user",
    "applied_to": ["*"]
  },
  "endpoint_id": "123e4567-e89b-12d3-a456-426614174000",
  "created_at": "2026-03-01T10:30:00Z",
  "updated_at": "2026-03-01T11:45:00Z"
}

Build docs developers (and LLMs) love