Aller au contenu

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.

Fenêtre 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>"}'
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
public_idstringObligatoire.
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
zone_idstring (uuid)Obligatoire.
ChampTypeDescription
dataobjectObligatoire. The new draft: its id, and the zone and unit it was drafted in.
data.draft_public_idstringObligatoire.
data.org_unit_idstringObligatoire.
data.zone_idstringObligatoire.
{
"data": {
"draft_public_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10",
"org_unit_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10",
"zone_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10"
}
}