Skip to content

Create an organization preset

POST/api/public/v1/policy-presets beta

A new organization preset from its source: the confirmed intent policies of a draft or the ratified intent policies of a live AIP (intent_policy_ids), the chosen rules of a preset (preset), or typed sentences with their dimension (sentences). Rules are copied by the server; a sentence already in the preset with the same dimension is skipped and returned in skipped. 409 PRESET_NAME_EXISTS for a name taken in the organization (case-insensitive) or a built-in title; 422 PRESET_EMPTY when no rule remains.

Terminal window
curl --fail-with-body -X POST 'https://app.openlatch.ai/api/public/v1/policy-presets' \
-H "Authorization: Bearer $OPENLATCH_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"name":"<preset_name>","description":"Created by the API examples.","source":{"sentences":[{"sentence":"Block a direct push to main.","dimension":"security"}]}}'
Role in the organizationThis endpoint
ownerAllowed
adminAllowed
editorAllowed
viewerNot allowed

A key carries the role its owner holds in the organization. See Authentication.

API key scope: presets:write

ParameterTypeDescription
Idempotency-Keystring or nullOptional. Makes the request safe to retry: the same key and the same request, within 24 hours, returns the stored response with Idempotent-Replayed: true and runs once.
FieldTypeDescription
descriptionstring or null
namestringRequired.
sourceobjectRequired. Exactly one of the three: intent policy ids, a preset selection, or typed sentences.
source.intent_policy_idsarray of string (uuid) or null
source.presetobject or null
source.preset.intentsarray of objectRequired.
source.preset.keystringRequired.
source.sentencesarray of object or null
FieldTypeDescription
dataobjectRequired. A create or an add: the preset, and the sentences not added because already in it.
data.created_byobject or null
data.created_by.namestringRequired.
data.default_selectedbooleanRequired. False for a framework preset, otherwise true.
data.descriptionstringRequired.
data.frameworkobject or nullRequired. Set on a framework preset; null on every other.
data.framework.noticeobject or nullRequired.
data.framework.sourceobjectRequired.
data.keystringRequired.
data.kindstring — one of builtin, organizationRequired.
data.revisioninteger or null
data.rulesarray of objectRequired.
data.rules[].capabilityobject or null
data.rules[].citationobject or nullRequired. What the rule cites, for a framework preset's rule; null for every other.
data.rules[].dimensionstring — one of quality, economics, security, safety, complianceRequired.
data.rules[].intent_keystringRequired.
data.rules[].sentencestringRequired.
data.skippedarray of string
data.titlestringRequired.
{
"data": {
"created_by": {
"name": "release-bot"
},
"default_selected": false,
"description": "string",
"framework": {
"notice": "string",
"source": {
"framework_url": "https://app.openlatch.ai/",
"github_url": "https://app.openlatch.ai/",
"license_name": "release-bot",
"license_url": "https://app.openlatch.ai/",
"name": "release-bot",
"source_commit": "string",
"source_date": "string"
}
},
"key": "string",
"kind": "builtin",
"revision": 3,
"rules": [
{
"capability": "enforce",
"citation": {
"entries": [
{}
],
"items": [
{}
]
},
"dimension": "quality",
"intent_key": "string",
"sentence": "string"
}
],
"skipped": [
"string"
],
"title": "string"
}
}