curl --request POST \
--url https://api.opper.ai/management/v1/controls/rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"config": {},
"enabled": true,
"id": "<string>",
"scope": {
"type": "<string>",
"function_uuids": [
"<string>"
],
"project_uuids": [
"<string>"
]
}
}
'import requests
url = "https://api.opper.ai/management/v1/controls/rules"
payload = {
"config": {},
"enabled": True,
"id": "<string>",
"scope": {
"type": "<string>",
"function_uuids": ["<string>"],
"project_uuids": ["<string>"]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
config: {},
enabled: true,
id: '<string>',
scope: {type: '<string>', function_uuids: ['<string>'], project_uuids: ['<string>']}
})
};
fetch('https://api.opper.ai/management/v1/controls/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"config": {},
"created_at": "2023-11-07T05:31:56Z",
"enabled": true,
"id": "<string>",
"kind": "<string>",
"schema_version": 123,
"scope": {
"type": "<string>",
"function_uuids": [
"<string>"
],
"project_uuids": [
"<string>"
]
},
"updated_at": "2023-11-07T05:31:56Z",
"allowed_model_ids": [
"<string>"
],
"confirm_file_deletion": true,
"effective_count": 123,
"name": "<string>",
"parent_allowlist": {
"countries": [
"<string>"
],
"handling": {
"cache_scopes": [
"<string>"
],
"caching": [
"<string>"
],
"human_review": [
"<string>"
],
"logging": [
"<string>"
],
"max_retention_days": 123,
"moderation": [
"<string>"
],
"subprocessors_read_content": true,
"training": [
"<string>"
]
},
"maker": {
"jurisdiction": [
"<string>"
],
"name": [
"<string>"
]
},
"models": [
"<string>"
],
"provider": {
"locations": {
"inference": {
"exclude": [
"<string>"
],
"include": [
"<string>"
]
},
"jurisdiction": {
"exclude": [
"<string>"
],
"include": [
"<string>"
]
},
"storage": {
"exclude": [
"<string>"
],
"include": [
"<string>"
]
}
},
"name": {
"exclude": [
"<string>"
],
"include": [
"<string>"
]
},
"route": {
"exclude": [
"<string>"
],
"include": [
"<string>"
]
}
},
"providers": [
"<string>"
],
"regions": [
"<string>"
],
"deny_all": true,
"exclude_providers": [
"<string>"
],
"exclude_service_routes": [
"<string>"
],
"service_routes": [
"<string>"
]
}
},
"meta": {}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}{
"allowed_plans": [
"<string>"
],
"current_plan": "<string>",
"error": "<string>",
"required_scope": "<string>"
}{
"code": "<string>",
"error": "<string>",
"file_count": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}Create a control rule
Creates a rule and enforces it from the next request. The client picks the id. A comply rule that turns its scope zero-day while files are stored there is refused with a 409 until confirm_file_deletion is sent. Requires the controls:write scope.
curl --request POST \
--url https://api.opper.ai/management/v1/controls/rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"config": {},
"enabled": true,
"id": "<string>",
"scope": {
"type": "<string>",
"function_uuids": [
"<string>"
],
"project_uuids": [
"<string>"
]
}
}
'import requests
url = "https://api.opper.ai/management/v1/controls/rules"
payload = {
"config": {},
"enabled": True,
"id": "<string>",
"scope": {
"type": "<string>",
"function_uuids": ["<string>"],
"project_uuids": ["<string>"]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
config: {},
enabled: true,
id: '<string>',
scope: {type: '<string>', function_uuids: ['<string>'], project_uuids: ['<string>']}
})
};
fetch('https://api.opper.ai/management/v1/controls/rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"config": {},
"created_at": "2023-11-07T05:31:56Z",
"enabled": true,
"id": "<string>",
"kind": "<string>",
"schema_version": 123,
"scope": {
"type": "<string>",
"function_uuids": [
"<string>"
],
"project_uuids": [
"<string>"
]
},
"updated_at": "2023-11-07T05:31:56Z",
"allowed_model_ids": [
"<string>"
],
"confirm_file_deletion": true,
"effective_count": 123,
"name": "<string>",
"parent_allowlist": {
"countries": [
"<string>"
],
"handling": {
"cache_scopes": [
"<string>"
],
"caching": [
"<string>"
],
"human_review": [
"<string>"
],
"logging": [
"<string>"
],
"max_retention_days": 123,
"moderation": [
"<string>"
],
"subprocessors_read_content": true,
"training": [
"<string>"
]
},
"maker": {
"jurisdiction": [
"<string>"
],
"name": [
"<string>"
]
},
"models": [
"<string>"
],
"provider": {
"locations": {
"inference": {
"exclude": [
"<string>"
],
"include": [
"<string>"
]
},
"jurisdiction": {
"exclude": [
"<string>"
],
"include": [
"<string>"
]
},
"storage": {
"exclude": [
"<string>"
],
"include": [
"<string>"
]
}
},
"name": {
"exclude": [
"<string>"
],
"include": [
"<string>"
]
},
"route": {
"exclude": [
"<string>"
],
"include": [
"<string>"
]
}
},
"providers": [
"<string>"
],
"regions": [
"<string>"
],
"deny_all": true,
"exclude_providers": [
"<string>"
],
"exclude_service_routes": [
"<string>"
],
"service_routes": [
"<string>"
]
}
},
"meta": {}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}{
"allowed_plans": [
"<string>"
],
"current_plan": "<string>",
"error": "<string>",
"required_scope": "<string>"
}{
"code": "<string>",
"error": "<string>",
"file_count": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}Authorizations
Management API authentication. Pass an op-mak-… management token as a Bearer token. Runtime op-… API keys are rejected with 403 — they belong on the data-plane endpoints. Mint a management key from the platform UI under Settings → API keys.
Body
The rule's configuration; shape depends on kind (see ManagementControlRule.config).
Whether the rule is enforced.
Client-chosen rule id (a UUID). Must be unique in the organization.
What the rule does: guard (input/output checks); observe (LLM-judge scoring); route (default model; cache; pool order); comply (model allowlist; retention; budget; zero data retention).
guard, observe, route, comply Where the rule applies: the whole organization (type org); a set of projects (type projects + project_uuids); a set of functions (type functions + function_uuids).
Show child attributes
Show child attributes
Acknowledges that a zero-day retention rule (comply.zdr or comply.retention with retention_days 0) permanently deletes every stored file in scope. Required when the scope holds files; the refusal is a 409 carrying file_count.
Display name.
How the runtime reads config. Omit for the current default; a version this deployment cannot decode is refused.