Skip to content

Update policy

PATCH
/v1/policies/{policyId}
curl --request PATCH \
--url https://example.com/v1/policies/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--header 'X-Tenant-ID: 2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \
--data '{ "name": "example", "description": "example", "enabled": true, "priority": 1, "max_duration_seconds": 1, "default_duration_seconds": 1, "notification_channel": "example" }'
policyId
required
string format: uuid
X-Tenant-ID
required
string format: uuid

Tenant identifier. Must match the tenant associated with the credential. Returns 403 tenant_mismatch if the credential and header belong to different tenants.

Media type application/json

Update an existing policy.

object
name
string
description
string
nullable
enabled
boolean
priority
integer
max_duration_seconds
integer
default_duration_seconds
integer
nullable
notification_channel
string
nullable
Example generated
{
"name": "example",
"description": "example",
"enabled": true,
"priority": 1,
"max_duration_seconds": 1,
"default_duration_seconds": 1,
"notification_channel": "example"
}

OK

Media type application/json

Full policy with nested rules.

object
id
required
string format: uuid
name
required

Policy name (required).

string
description

Optional description.

string
nullable
enabled
required

Whether the policy is active.

boolean
priority
required

Higher values evaluated first.

integer
max_duration_seconds
required

Maximum allowed grant duration in seconds (required).

integer
default_duration_seconds

Default grant duration if not specified in request.

integer
nullable
notification_channel

Optional notification channel for approvals.

string
nullable
rules
required

Nested rules for this policy.

Array<object>

Single rule within a policy.

object
id
required
string format: uuid
ordinal
required

Evaluation order within the policy.

integer
effect
required
string
Allowed values: permit forbid
policy_text
required

Assembled Cedar text for this rule.

string
principal_scope_type
required
string
Allowed values: any eq in is is_in
principal_entity_type
string
nullable
principal_entity_id
string
nullable
action_scope_type
required
string
Allowed values: any eq in
action_ids
Array<string>
resource_scope_type
required
string
Allowed values: any eq in is is_in
resource_entity_type
string
nullable
resource_entity_id
string
nullable
conditions

Raw Cedar when/unless clause text.

string
nullable
notice

User-facing message for this rule.

string
nullable
audit_session

Whether grants should have session auditing.

boolean
created_at
required
string format: date-time
cedar_policy_set
required

Assembled Cedar policy text for all rules.

string
created_at
required
string format: date-time
updated_at
required
string format: date-time
Example
{
"rules": [
{
"effect": "permit",
"principal_scope_type": "any",
"action_scope_type": "any",
"resource_scope_type": "any"
}
]
}

Invalid input

Media type application/json
object
code
required

Machine-readable error code (e.g. “not_found”, “tenant_mismatch”).

string
message
required

Human-readable description of the error.

string
details

Optional additional context about the error.

object
key
additional properties
any
notices

Policy notices from determining Cedar rules, if applicable.

Array<string>
Example generated
{
"code": "example",
"message": "example",
"details": {},
"notices": [
"example"
]
}

Unauthenticated

Media type application/json
object
code
required

Machine-readable error code (e.g. “not_found”, “tenant_mismatch”).

string
message
required

Human-readable description of the error.

string
details

Optional additional context about the error.

object
key
additional properties
any
notices

Policy notices from determining Cedar rules, if applicable.

Array<string>
Example generated
{
"code": "example",
"message": "example",
"details": {},
"notices": [
"example"
]
}

Forbidden

Media type application/json
object
code
required

Machine-readable error code (e.g. “not_found”, “tenant_mismatch”).

string
message
required

Human-readable description of the error.

string
details

Optional additional context about the error.

object
key
additional properties
any
notices

Policy notices from determining Cedar rules, if applicable.

Array<string>
Example generated
{
"code": "example",
"message": "example",
"details": {},
"notices": [
"example"
]
}

Not found

Media type application/json
object
code
required

Machine-readable error code (e.g. “not_found”, “tenant_mismatch”).

string
message
required

Human-readable description of the error.

string
details

Optional additional context about the error.

object
key
additional properties
any
notices

Policy notices from determining Cedar rules, if applicable.

Array<string>
Example generated
{
"code": "example",
"message": "example",
"details": {},
"notices": [
"example"
]
}