Ir al contenido

Copy a policy to a zone

POST/api/public/v1/policies/{public_id}/copy

Creates a new draft in a live Autonomy Zone from the intent policies in force of this AIP (their sentences, answers, rules, cases and citations, marked confirmed), planned in monitor, and answers 201 {draft_public_id, zone_id, org_unit_id}; the draft is read with GET /aip/drafts/{public_id} and ratified like any other. The new AIP has its own id and history, and its provenance names the source (copied_from); evidence stays with the source. Copying into the source's own zone is allowed. Makes no AI call. A retry with the same Idempotency-Key returns the first draft and creates no second one. 409 RETIRED for a deleted source, 404 ZONE_NOT_FOUND, 422 ZONE_UNAVAILABLE for a retired zone.

Ventana de terminal
curl --fail-with-body -X POST 'https://app.openlatch.ai/api/public/v1/policies/<policy_public_id>/copy' \
-H "Authorization: Bearer $OPENLATCH_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"zone_id":"<zone_id>"}'
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.
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
zone_idstring (uuid)Obligatorio.
CampoTipoDescripción
dataobjectObligatorio. The new draft: its id, and the zone and unit it was drafted in.
data.draft_public_idstringObligatorio.
data.org_unit_idstringObligatorio.
data.zone_idstringObligatorio.
{
"data": {
"draft_public_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10",
"org_unit_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10",
"zone_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10"
}
}