cURL
curl --request POST \ --url https://control-plane.kubiya.ai/api/v1/policies \ --header 'Authorization: <api-key>' \ --header 'Content-Type: application/json' \ --data ' { "name": "<string>", "policy_content": "<string>", "description": "<string>", "enabled": true, "tags": [ "<string>" ], "metadata": {} } '
{ "id": "<string>", "name": "<string>", "description": "<string>", "organization_id": "<string>", "enabled": true, "tags": [ "<string>" ], "version": 123, "created_at": "<string>", "updated_at": "<string>", "policy_content": "", "created_by": "<string>", "updated_by": "<string>", "policy_type": "rego", "association_count": 0 }
Create a new OPA policy in the enforcer service.
The policy will be stored in the enforcer service and can then be associated with entities (agents, teams, environments).
Schema for creating a new policy
1 - 255
1
Successful Response
Extended policy response with association count
Was this page helpful?