POST
/api/policiesCreate a policy
Creates a policy with its name, enabled state, and rules. Supply name, enabled, and rules; you can also provide a description and source posture check IDs.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Policy configuration containing its name, enabled state, and rules.
descriptionstringoptional
Policy friendly description
enabledbooleanrequired
Policy status
namestringrequired
Policy name identifier
rulesarray<object>required
Policy rule object for policy UI editor
source_posture_checksarray<string>optional
Posture checks ID's applied to policy source groups
200Returns the created policy object, including its name, enabled state, rules, and source posture checks.
descriptionstringoptional
Policy friendly description
enabledbooleanrequired
Policy status
namestringrequired
Policy name identifier
idstringoptional
Policy ID
rulesarray<object>required
Policy rule object for policy UI editor
source_posture_checksarray<string>required
Posture checks ID's applied to policy source groups
Error handling
name, enabled, and rules are required. Each value must match the corresponding field's expected type: a string for name, a boolean for enabled, and an array for rules.