Aller au contenu

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.

Fenêtre 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"}'
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 : policies:write

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
languagestring or null
modestring — one of disabled, monitor, enforceObligatoire.
sentencesarray of one of: string, objectObligatoire.
sentences[] (StatedSentenceIn).dimensionstring — one of quality, economics, security, safety, compliance
sentences[] (StatedSentenceIn).sentencestringObligatoire.
zone_idsarray of string (uuid)Obligatoire.
ChampTypeDescription
dataobjectObligatoire. `202 for a job-starting operation: poll GET /aip/jobs/{job_id}`.
data.job_idstringObligatoire.
{
"data": {
"job_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10"
}
}