Skip to main content
POST
Create policy draft

Authorizations

Authorization
string
header
required

Organization Admin API key with an appropriate scope. Customer keys cannot call organization routes.

Headers

Idempotency-Key
string
required

Stable identifier of 8–200 printable characters. Reuse it only for an identical operation.

Required string length: 8 - 200

Body

application/json
name
string
required
Required string length: 1 - 80
rule
string
required

A yes-or-no question ending with ?.

Required string length: 1 - 20000
direction
enum<string>
required
Available options:
request,
response,
both
scope
enum<string>
required
Available options:
organization,
projects,
unattached
description
string
default:""
Maximum string length: 240
mode
enum<string>
default:monitoring
Available options:
monitoring,
enforcing
project_ids
string[]
Maximum array length: 1000
match_threshold_basis_points
integer | null

Optional match threshold from 1 to 9,999; null restores the backend default.

Required range: 1 <= x <= 9999

Response

Resource created or exact idempotent creation replayed.

id
string
required
name
string
required
description
string
required
state
enum<string>
required
Available options:
draft,
monitoring,
enforcing,
paused
revision
integer
required

Current edit revision. Mutations must send the latest value.

has_unpublished_changes
boolean
required
created_at
integer
required
updated_at
integer
required
draft
object
required
object
string
default:organization.policy
Allowed value: "organization.policy"
current_version
integer | null

Active published version number, or null before first publication.

published
object | null