Aller au contenu

Rename or describe an organization preset

PATCH/api/public/v1/policy-presets/{key} beta

revision is the one the caller read; a stale one answers 409 PRESET_CHANGED. description: null clears it. 409 PRESET_READ_ONLY for a built-in preset; 422 EMPTY_PATCH with neither field.

Fenêtre de terminal
curl --fail-with-body -X PATCH 'https://app.openlatch.ai/api/public/v1/policy-presets/<preset_key>' \
-H "Authorization: Bearer $OPENLATCH_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"revision":<revision>,"description":"Updated by the API examples."}'
Rôle dans l’organisationCe point de terminaison
ownerAutorisé
adminAutorisé
editorAutorisé
viewerNon autorisé

Une clé porte le rôle que son propriétaire détient dans l’organisation. Voir Authentification.

Portée de clé d’API : presets:write

ParamètreTypeDescription
keystringObligatoire.
ParamètreTypeDescription
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.
ChampTypeDescription
descriptionstring or null
namestring or null
revisionintegerObligatoire.
ChampTypeDescription
dataobjectObligatoire. One preset: built-in (read-only for every role) or the organization's own.
data.created_byobject or null
data.created_by.namestringObligatoire.
data.default_selectedbooleanObligatoire. False for a framework preset, otherwise true.
data.descriptionstringObligatoire.
data.frameworkobject or nullObligatoire. Set on a framework preset; null on every other.
data.framework.noticeobject or nullObligatoire.
data.framework.sourceobjectObligatoire.
data.keystringObligatoire.
data.kindstring — one of builtin, organizationObligatoire.
data.revisioninteger or null
data.rulesarray of objectObligatoire.
data.rules[].capabilityobject or null
data.rules[].citationobject or nullObligatoire. What the rule cites, for a framework preset's rule; null for every other.
data.rules[].dimensionstring — one of quality, economics, security, safety, complianceObligatoire.
data.rules[].intent_keystringObligatoire.
data.rules[].sentencestringObligatoire.
data.titlestringObligatoire.
{
"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"
}
],
"title": "string"
}
}