Ir al contenido

State sentences as a policy

POST/api/public/v1/policies/stated

Grounds each stated sentence in a read_ground job, then ratifies every sentence that is grounded or deferred into zone_ids — one Autonomy Zone (409 ONE_ZONE_PER_AIP for more) — in the mode; the caller is recorded as its ratifier, and a refused sentence creates nothing. Answers 202 with the job to poll; its result names the AIP (policy_public_id, null when every sentence was refused). A sentence is a string (dimension security) or {sentence, dimension}. An agent (OAuth) caller is refused with 403 AGENT_AUTHORING_VIA_DRAFTS: agents author intent policies through drafts.

Ventana de terminal
curl --fail-with-body -X POST 'https://app.openlatch.ai/api/public/v1/policies/stated' \
-H "Authorization: Bearer $OPENLATCH_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"sentences":["Block a direct push to main."],"zone_ids":["<zone_id>"],"mode":"monitor"}'
Rol en la organizaciónEste punto de conexión
ownerPermitido
adminPermitido
editorPermitido
viewerNo permitido

Una clave tiene el rol que su propietario ocupa en la organización. Consulte Autenticación.

Ámbito de la clave de API: policies:write

ParámetroTipoDescripción
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.
CampoTipoDescripción
languagestring or null
modestring — one of disabled, monitor, enforceObligatorio.
sentencesarray of one of: string, objectObligatorio.
sentences[] (StatedSentenceIn).dimensionstring — one of quality, economics, security, safety, compliance
sentences[] (StatedSentenceIn).sentencestringObligatorio.
zone_idsarray of string (uuid)Obligatorio.
CampoTipoDescripción
dataobjectObligatorio. `202 for a job-starting operation: poll GET /aip/jobs/{job_id}`.
data.job_idstringObligatorio.
{
"data": {
"job_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10"
}
}