Skip to content

Create a policy (admin only)

POST
/api/v1/policies
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 }'
Media typeapplication/json
PolicyCreate
object
key
required
Key
string
>= 1 characters <= 128 characters
name
required
Name
string
description
Description
Any of:
string
jurisdiction_code
required
Jurisdiction Code
string
version
Version
string
default: 1.0.0
severity
PolicySeverity
string
default: medium
Allowed values: critical high medium low info
opa_package
required
Opa Package
string
rego_code
Rego Code
Any of:
string
rules
Rules
object
key
additional properties
any
remediation
Remediation
Any of:
string
applies_to_risk_tiers
Applies To Risk Tiers
Array<string>
Allowed values: prohibited high limited minimal unknown
is_active
Is Active
boolean
default: true

Successful Response

Media typeapplication/json
object
success
required
boolean
default: true
data
required
PolicyRead
object
key
required
Key
string
>= 1 characters <= 128 characters
name
required
Name
string
description
Description
Any of:
string
jurisdiction_code
required
Jurisdiction Code
string
version
Version
string
default: 1.0.0
severity
PolicySeverity
string
default: medium
Allowed values: critical high medium low info
opa_package
required
Opa Package
string
rego_code
Rego Code
Any of:
string
rules
Rules
object
key
additional properties
any
remediation
Remediation
Any of:
string
applies_to_risk_tiers
Applies To Risk Tiers
Array<string>
Allowed values: prohibited high limited minimal unknown
is_active
Is Active
boolean
default: true
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
error
required
ErrorDetail
object
code
required
Code
string
message
required
Message
string
details
Details
correlation_id
Correlation Id
Any of:
string

Example

{
"error": {
"code": "not_found",
"correlation_id": "0f4b9a2e-6c2b-4f0e-9a4a-1c2b3d4e5f60",
"message": "AI system not found."
}
}

Forbidden

Media typeapplication/json
ErrorResponse
object
error
required
ErrorDetail
object
code
required
Code
string
message
required
Message
string
details
Details
correlation_id
Correlation Id
Any of:
string

Example

{
"error": {
"code": "not_found",
"correlation_id": "0f4b9a2e-6c2b-4f0e-9a4a-1c2b3d4e5f60",
"message": "AI system not found."
}
}

Not Found

Media typeapplication/json
ErrorResponse
object
error
required
ErrorDetail
object
code
required
Code
string
message
required
Message
string
details
Details
correlation_id
Correlation Id
Any of:
string

Example

{
"error": {
"code": "not_found",
"correlation_id": "0f4b9a2e-6c2b-4f0e-9a4a-1c2b3d4e5f60",
"message": "AI system not found."
}
}

Conflict

Media typeapplication/json
ErrorResponse
object
error
required
ErrorDetail
object
code
required
Code
string
message
required
Message
string
details
Details
correlation_id
Correlation Id
Any of:
string

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>
ValidationError
object
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": {}
}
]
}