The policies in force at one zone
GET/api/public/v1/zones/{zone_id}/policies
The AIPs attached on the layer stack, each once: effective_mode is the strictest of its attachments on the path, attachment_mode this zone's own (null when it only inherits it) and attached_here whether this zone holds it; layer is this zone when it does, else the zone whose attachment sets the mode. mode filters on effective_mode; layer=authored keeps the AIPs attached here. dimensions[] is COMPUTED as the union of the policy's atoms' dimensions.
curl --fail-with-body -X GET 'https://app.openlatch.ai/api/public/v1/zones/<zone_id>/policies' \ -H "Authorization: Bearer $OPENLATCH_API_KEY"import jsonimport osimport urllib.request
request = urllib.request.Request( 'https://app.openlatch.ai/api/public/v1/zones/<zone_id>/policies', method='GET', 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 GET 'https://app.openlatch.ai/api/public/v1/zones/<zone_id>/policies' \ -H "Authorization: Bearer $OPENLATCH_API_KEY" | jq .$headers = @{ Authorization = "Bearer $env:OPENLATCH_API_KEY"}Invoke-RestMethod -Method GET -Uri 'https://app.openlatch.ai/api/public/v1/zones/<zone_id>/policies' -Headers $headers | ConvertTo-Json -Depth 20Authorization
Section titled “Authorization”| Role in the organization | This endpoint |
|---|---|
owner | Allowed |
admin | Allowed |
editor | Allowed |
viewer | Allowed |
A key carries the role its owner holds in the organization. See Authentication.
API key scope: policies:read
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
zone_id | string (uuid) | Required. |
Query parameters
Section titled “Query parameters”| Parameter | Type | Description |
|---|---|---|
dimension | string or null | |
mode | string or null | |
layer | string or null | |
q | string or null | |
page | integer | |
page_size | integer |
Response
Section titled “Response”- 200 OK — the call succeeded.
- 401 Unauthorized —
UNAUTHORIZED - 402 Payment Required —
license_expired - 403 Forbidden —
FEATURE_DISABLED,FORBIDDEN,INSUFFICIENT_SCOPE - 404 Not Found —
NOT_FOUND - 422 Unprocessable Content —
INVALID_ID,VALIDATION_ERROR - 429 Too Many Requests —
TOO_MANY_REQUESTS - 500 Internal Server Error —
INTERNAL_SERVER_ERROR,tenant_isolation_violation - 503 Service Unavailable —
ENGINE_UNAVAILABLE,FEATURE_STATE_UNAVAILABLE,SERVICE_UNAVAILABLE
Response fields
Section titled “Response fields”| Field | Type | Description |
|---|---|---|
data | array of object | Required. |
data[].anomalies_7d | integer | |
data[].attached_here | boolean | Whether the viewed zone holds its own attachment. |
data[].attachment_mode | string — one of disabled, monitor, enforce or null | The viewed zone's own attachment mode; null when it only inherits the AIP. |
data[].coverage | object | Required. D-66 — installs counted from stamped negotiation, never from mode + recent poll. |
data[].coverage.compatibility_unavailable_installs | integer | Required. |
data[].coverage.enforced_installs | integer | Required. |
data[].dimensions | array of string | Required. |
data[].display_title | string | The AIP's name: its title, else its generated_title, else its statement. |
data[].effective_layer | object or null | The zone whose attachment sets effective_mode when it is not layer; null otherwise. |
data[].effective_mode | string — one of disabled, monitor, enforce or null | The mode the AIP runs in at the viewed zone: the strictest attachment on its path. |
data[].id | string | Required. |
data[].intents | object | Required. How many of the policy's atoms are actually enforceable. |
data[].intents.enforceable | integer | Required. |
data[].intents.monitor_only | integer | Required. |
data[].intents.total | integer | Required. |
data[].layer | object | Required. The layer a policy row is labelled with: the zone being viewed when it holds the AIP, else the zone whose
attachment sets its mode there. `inherited` is true when the viewed zone holds no attachment of it. |
data[].layer.inherited | boolean | Required. |
data[].layer.label | string | Required. |
data[].layer.unit_id | string | Required. |
data[].layer.zone_id | string | Required. |
data[].mode | string | Required. Deprecated: attachment_mode when the viewed zone holds it, else effective_mode. |
data[].preset | object or null | |
data[].public_id | string | Required. |
data[].statement | string | Required. |
data[].status | string | Required. |
data[].version | integer | Required. |
page | integer | Required. |
page_size | integer | Required. |
total | integer | Required. |
Example response
Section titled “Example response”{ "data": [ { "anomalies_7d": 0, "attached_here": false, "attachment_mode": "disabled", "coverage": { "compatibility_unavailable_installs": 3, "enforced_installs": 3 }, "dimensions": [ "string" ], "display_title": "", "effective_layer": { "inherited": false, "label": "string", "unit_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "zone_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10" }, "effective_mode": "disabled", "id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "intents": { "enforceable": 3, "monitor_only": 3, "total": 3 }, "layer": { "inherited": false, "label": "string", "unit_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "zone_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10" }, "mode": "string", "preset": { "application_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "preset_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "preset_name": "release-bot", "preset_policy_key": "string", "preset_version": 3 }, "public_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "statement": "string", "status": "string", "version": 3 } ], "page": 1, "page_size": 3, "total": 3}