Ir al contenido

Apply an earlier version of a policy

POST/api/public/v1/policies/{public_id}/versions/{version}/apply

Ratifies a new version whose intent policies are copies of version version's: every sentence with its rules, cases, fallback, answers and answered exceptions. The earlier versions and their history stay; the AIP's zones and their modes are kept, and their bundles carry the new version. One audit entry names both versions. 202 with a job already succeeded (GET /aip/jobs/{job_id}), whose result is {version, applied_version, previous_version}. An open edit draft keeps its rows and answers 409 EDIT_DRAFT_STALE at ratify. 409 NOT_RATIFIED also answers a version ratified before the engine swap (details[] reason pre_swap_version). An agent (OAuth) caller must send sentences, the version's ratified sentences: 428 SENTENCES_REQUIRED without them, 409 SENTENCES_MISMATCH unless they match.

Ventana de terminal
curl --fail-with-body -X POST 'https://app.openlatch.ai/api/public/v1/policies/<policy_public_id>/versions/<version>/apply' \
-H "Authorization: Bearer $OPENLATCH_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"sentences":<sentences>}'
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
public_idstringObligatorio.
versionintegerObligatorio.
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
sentencesarray of string or nullThe exact sentences this call puts in force, as shown to the user. Required of an agent (OAuth) caller: 428 SENTENCES_REQUIRED without them, 409 SENTENCES_MISMATCH unless they match the sentences put in force (the same sentences, order ignored, each as many times as it appears, after Unicode NFC and whitespace normalisation).
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"
}
}