Remove a rule from an organization preset
DELETE/api/public/v1/policy-presets/{key}/rules/{rule_id} beta
revision is the one the caller read. 409 PRESET_EMPTY on the last rule of the preset: delete the preset instead. 409 PRESET_CHANGED for a stale revision; 409 PRESET_READ_ONLY for a built-in.
curl --fail-with-body -X DELETE 'https://app.openlatch.ai/api/public/v1/policy-presets/<preset_key>/rules/<rule_id>?revision=<preset_revision>' \ -H "Authorization: Bearer $OPENLATCH_API_KEY"import jsonimport osimport urllib.request
request = urllib.request.Request( 'https://app.openlatch.ai/api/public/v1/policy-presets/<preset_key>/rules/<rule_id>?revision=<preset_revision>', method='DELETE', headers={ 'Authorization': 'Bearer ' + os.environ['OPENLATCH_API_KEY'], },)with urllib.request.urlopen(request) as response: text = response.read().decode() print(json.dumps(json.loads(text), indent=2) if text else response.status)#!/usr/bin/env bashset -euo pipefail
curl -sS --fail-with-body -X DELETE 'https://app.openlatch.ai/api/public/v1/policy-presets/<preset_key>/rules/<rule_id>?revision=<preset_revision>' \ -H "Authorization: Bearer $OPENLATCH_API_KEY" | jq .$headers = @{ Authorization = "Bearer $env:OPENLATCH_API_KEY"}Invoke-RestMethod -Method DELETE -Uri 'https://app.openlatch.ai/api/public/v1/policy-presets/<preset_key>/rules/<rule_id>?revision=<preset_revision>' -Headers $headers | ConvertTo-Json -Depth 20Autorisation
Section intitulée « Autorisation »| Rôle dans l’organisation | Ce point de terminaison |
|---|---|
owner | Autorisé |
admin | Autorisé |
editor | Autorisé |
viewer | Non 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ètres de chemin
Section intitulée « Paramètres de chemin »| Paramètre | Type | Description |
|---|---|---|
key | string | Obligatoire. |
rule_id | string | Obligatoire. |
Paramètres de requête
Section intitulée « Paramètres de requête »| Paramètre | Type | Description |
|---|---|---|
revision | integer | Obligatoire. |
Paramètres d’en-tête
Section intitulée « Paramètres d’en-tête »| Paramètre | Type | Description |
|---|---|---|
Idempotency-Key | string or null | Optional. 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. |
- 200 OK — l’appel a réussi.
- 401 Unauthorized —
UNAUTHORIZED - 402 Payment Required —
license_expired - 403 Forbidden —
FEATURE_DISABLED,FORBIDDEN,INSUFFICIENT_SCOPE - 404 Not Found —
NOT_FOUND - 409 Conflict —
IDEMPOTENCY_IN_PROGRESS,PRESET_CHANGED,PRESET_EMPTY,PRESET_READ_ONLY - 422 Unprocessable Content —
IDEMPOTENCY_KEY_REUSED,INVALID_ID,PRESET_EMPTY,VALIDATION_ERROR - 429 Too Many Requests —
TOO_MANY_REQUESTS - 500 Internal Server Error —
INTERNAL_SERVER_ERROR,tenant_isolation_violation - 503 Service Unavailable —
FEATURE_STATE_UNAVAILABLE,SERVICE_UNAVAILABLE
Champs de la réponse
Section intitulée « Champs de la réponse »| Champ | Type | Description |
|---|---|---|
data | object | Obligatoire. One preset: built-in (read-only for every role) or the organization's own. |
data.created_by | object or null | |
data.created_by.name | string | Obligatoire. |
data.default_selected | boolean | Obligatoire. False for a framework preset, otherwise true. |
data.description | string | Obligatoire. |
data.framework | object or null | Obligatoire. Set on a framework preset; null on every other. |
data.framework.notice | object or null | Obligatoire. |
data.framework.source | object | Obligatoire. |
data.key | string | Obligatoire. |
data.kind | string — one of builtin, organization | Obligatoire. |
data.revision | integer or null | |
data.rules | array of object | Obligatoire. |
data.rules[].capability | object or null | |
data.rules[].citation | object or null | Obligatoire. What the rule cites, for a framework preset's rule; null for every other. |
data.rules[].dimension | string — one of quality, economics, security, safety, compliance | Obligatoire. |
data.rules[].intent_key | string | Obligatoire. |
data.rules[].sentence | string | Obligatoire. |
data.title | string | Obligatoire. |
Exemple de réponse
Section intitulée « Exemple de réponse »{ "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" }}