Create a policy (admin only)
POST
/api/v1/policies
const url = 'https://example.com/api/v1/policies';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"key":"eu_high_risk_human_oversight","name":"EU AI Act Art. 14 - Human oversight","description":"example","jurisdiction_code":"EU","version":"1.0.0","severity":"critical","opa_package":"aigov.eu.high_risk","rego_code":"example","rules":{},"remediation":"example","applies_to_risk_tiers":["high"],"is_active":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/policies \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "key": "eu_high_risk_human_oversight", "name": "EU AI Act Art. 14 - Human oversight", "description": "example", "jurisdiction_code": "EU", "version": "1.0.0", "severity": "critical", "opa_package": "aigov.eu.high_risk", "rego_code": "example", "rules": {}, "remediation": "example", "applies_to_risk_tiers": [ "high" ], "is_active": true }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
PolicyCreate
object
key
required
Key
string
name
required
Name
string
jurisdiction_code
required
Jurisdiction Code
string
version
Version
string
severity
PolicySeverity
string
opa_package
required
Opa Package
string
rules
Rules
object
key
additional properties
any
applies_to_risk_tiers
Applies To Risk Tiers
Array<string>
is_active
Is Active
boolean
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
object
success
required
boolean
data
required
PolicyRead
object
key
required
Key
string
name
required
Name
string
jurisdiction_code
required
Jurisdiction Code
string
version
Version
string
severity
PolicySeverity
string
opa_package
required
Opa Package
string
rules
Rules
object
key
additional properties
any
applies_to_risk_tiers
Applies To Risk Tiers
Array<string>
is_active
Is Active
boolean
id
required
Id
string format: uuid
created_at
required
Created At
string format: date-time
updated_at
required
Updated At
string format: date-time
Example
{ "success": true, "data": { "key": "eu_high_risk_human_oversight", "name": "EU AI Act Art. 14 - Human oversight", "jurisdiction_code": "EU", "version": "1.0.0", "severity": "critical", "opa_package": "aigov.eu.high_risk", "applies_to_risk_tiers": [ "high" ], "is_active": true }}Unauthorized
Media typeapplication/json
ErrorResponse
object
Example
{ "error": { "code": "not_found", "correlation_id": "0f4b9a2e-6c2b-4f0e-9a4a-1c2b3d4e5f60", "message": "AI system not found." }}Forbidden
Media typeapplication/json
ErrorResponse
object
Example
{ "error": { "code": "not_found", "correlation_id": "0f4b9a2e-6c2b-4f0e-9a4a-1c2b3d4e5f60", "message": "AI system not found." }}Not Found
Media typeapplication/json
ErrorResponse
object
Example
{ "error": { "code": "not_found", "correlation_id": "0f4b9a2e-6c2b-4f0e-9a4a-1c2b3d4e5f60", "message": "AI system not found." }}Conflict
Media typeapplication/json
ErrorResponse
object
Example
{ "error": { "code": "not_found", "correlation_id": "0f4b9a2e-6c2b-4f0e-9a4a-1c2b3d4e5f60", "message": "AI system not found." }}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}