Ir al contenido

Crear una unidad organizativa manual

POST/api/public/v1/org-units

A unit a human authored, under an existing parent. source is manual, so a directory sync never removes it and the tree can be shaped in an organization with no directory connected at all. Depth is capped at 10 and the cap is a REJECTION here (422 DEPTH_EXCEEDED), never the silent truncation the ingest path applies. An optional zone: {agent_ids} creates the unit with its Autonomy Zone enabled and pins those agents to it by hand, all in one transaction.

Ventana de terminal
curl --fail-with-body -X POST 'https://app.openlatch.ai/api/public/v1/org-units' \
-H "Authorization: Bearer $OPENLATCH_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"parent_id":"<parent_id>","name":"<unit_name>"}'
Rol en la organizaciónEste punto de conexión
ownerPermitido
adminPermitido
editorNo permitido
viewerNo permitido

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

Ámbito de la clave de API: org: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
namestringObligatorio.
parent_idstring (uuid)Obligatorio.
zoneobject or nullCreate the unit with its Autonomy Zone enabled, and pin agent_ids to it, in one transaction. Omit for a unit without a zone.
zone.agent_idsarray of string or nullAgents pinned to the new zone by hand in the same transaction (at most 5 000; an id that is not an agent of this organization answers 404 AGENT_NOT_FOUND).
CampoTipoDescripción
agents_countintegerObligatorio.
agents_directinteger or null
depthintegerObligatorio.
effective_zone_idstring or null
idstringObligatorio.
namestringObligatorio.
parent_idstring or null
pathstringObligatorio.
policies_added_hereintegerObligatorio.
policies_in_forceintegerObligatorio.
shortstring or null
sourcestringObligatorio.
zoneobject or null
zone.ask_modestring or null
zone.effective_ask_modestring
zone.idstringObligatorio.
zone.is_defaultbooleanWhether this is the organization's default zone: it serves agents with no owner and no pin.
zone.is_rootbooleanObligatorio.
zone.limitsobject or null
{
"agents_count": 3,
"agents_direct": 3,
"depth": 3,
"effective_zone_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10",
"id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10",
"name": "release-bot",
"parent_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10",
"path": "Engineering / Platform",
"policies_added_here": 3,
"policies_in_force": 3,
"short": "string",
"source": "string",
"zone": {
"ask_mode": "string",
"effective_ask_mode": "both",
"id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10",
"is_default": false,
"is_root": false,
"limits": {
"cannot_prompt": 3,
"in_scope": 3,
"shell_only": 3
}
}
}