Skip to content

Create a hand-made org unit

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.

Terminal window
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>"}'
Role in the organizationThis endpoint
ownerAllowed
adminAllowed
editorNot allowed
viewerNot allowed

A key carries the role its owner holds in the organization. See Authentication.

API key scope: org:write

ParameterTypeDescription
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.
FieldTypeDescription
namestringRequired.
parent_idstring (uuid)Required.
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).
FieldTypeDescription
agents_countintegerRequired.
agents_directinteger or null
depthintegerRequired.
effective_zone_idstring or null
idstringRequired.
namestringRequired.
parent_idstring or null
pathstringRequired.
policies_added_hereintegerRequired.
policies_in_forceintegerRequired.
shortstring or null
sourcestringRequired.
zoneobject or null
zone.ask_modestring or null
zone.effective_ask_modestring
zone.idstringRequired.
zone.is_defaultbooleanWhether this is the organization's default zone: it serves agents with no owner and no pin.
zone.is_rootbooleanRequired.
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
}
}
}