Skip to main content

Org Unit API

Table of Contents

Top

upsquad/orgunit/v1/orgunit.proto

AcceptOfferRequest

FieldTypeLabelDescription
accepting_unit_idstring
kindOfferKind
item_idstring
from_unit_idstring

AcceptOfferResponse

FieldTypeLabelDescription
accepted_offerAcceptedOffer

AcceptedOffer

AcceptedOffer is the wire form of a unit_accepted_offers row.

FieldTypeLabelDescription
idstring
org_idstring
accepting_unit_idstring
kindOfferKind
item_idstring
from_unit_idstring
accepted_bystring
accepted_atgoogle.protobuf.Timestamp

AddUnitRelationRequest

FieldTypeLabelDescription
parent_unit_idstring
child_unit_idstring
labelstring

AddUnitRelationResponse

FieldTypeLabelDescription
statusGovernedOpStatus
draft_idstringdraft_id is the org_draft that carries the pending/published op.
approval_idstringapproval_id is the resource-scoped approval opened for a PENDING op.
relationUnitRelationrelation is populated when status == APPLIED.

AdminResolveAllTeamsUnionRequest

AdminResolveAllTeamsUnionRequest is the FR-15 admin/audit union request.

FieldTypeLabelDescription
org_idstring
member_idstring

AdminResolveAllTeamsUnionResponse

FieldTypeLabelDescription
configEffectiveConfig

AppointUnitAdminRequest

FieldTypeLabelDescription
unit_idstring
candidate_member_idstring

AppointUnitAdminResponse

FieldTypeLabelDescription
statusGovernedOpStatus
draft_idstring
approval_idstring
missing_privilegesstringrepeatedmissing_privileges lists the capability floors the candidate fails (populated when status == REJECTED per FR-30).

ApproveModelAllowlistEntryRequest

ApproveModelAllowlistEntryRequest approves a single pending entry.

FieldTypeLabelDescription
entry_idstringentry_id is the pending ModelAllowlistEntry to approve. Required.
decided_bystringdecided_by is the acting Manager's member id — carried explicitly per the orgunit service convention (matches SetTeamModelAllowlist.configured_by).

ApproveModelAllowlistEntryResponse

ApproveModelAllowlistEntryResponse carries the post-approval entry.

FieldTypeLabelDescription
entryModelAllowlistEntryentry is the entry after transition (approval_status='approved').

ApproveUnitAdminRequest

FieldTypeLabelDescription
draft_idstring

ApproveUnitAdminResponse

FieldTypeLabelDescription
statusGovernedOpStatus

AssignMemberRequest

FieldTypeLabelDescription
org_idstringorg_id is the tenant organisation UUID.
member_idstringmember_id is the UUID of the member.
unit_idstringunit_id is the UUID of the unit.
rolestringrole is one of member

AssignMemberResponse

FieldTypeLabelDescription
membershipMembershipmembership is the created or updated membership.
already_existedboolalready_existed is true when the (member, unit) pair was already present.

AttachToolRequest

FieldTypeLabelDescription
unit_idstring
tool_idstring
config_jsonstring
visibilitystring
configured_bystring

AttachToolResponse

FieldTypeLabelDescription
bindingToolBinding

ConflictResolution

ConflictResolution records one name collision and the action taken.

FieldTypeLabelDescription
child_namestringchild_name is the colliding display name.
policyConflictPolicypolicy is the policy applied to this conflict (echoes the request policy for now; future per-row policy hooks would diverge here).
moved_unit_idstringmoved_unit_id is the UUID of the source-side child involved in the collision.
target_unit_idstringtarget_unit_id is the UUID of the target-side child that already owned child_name.
resulting_namestringresulting_name is the post-resolution name carried by moved_unit_id when the policy was RENAME (e.g. "Engineering (merged)"). Empty when the policy was SKIP or OVERWRITE.

CreateUnitRequest

FieldTypeLabelDescription
org_idstringorg_id is the tenant organisation UUID.
parent_idstringparent_id is the UUID of the parent unit; empty = root.
namestringname is the display name of the unit.
unit_typestringunit_type is "pillar"

CreateUnitResponse

FieldTypeLabelDescription
unitUnitunit is the newly created unit (with ancestor_path and depth).

DeclineOfferRequest

FieldTypeLabelDescription
accepting_unit_idstring
kindOfferKind
item_idstring
from_unit_idstring

DeclineOfferResponse

FieldTypeLabelDescription
declinedbool

DeleteUnitRequest

FieldTypeLabelDescription
idstringid is the unit UUID.
reparent_childrenboolreparent_children, when true, moves the unit's direct children up to the deleted unit's parent before the soft-delete.

DeleteUnitResponse

FieldTypeLabelDescription
deleted_atgoogle.protobuf.Timestampdeleted_at is the soft-delete timestamp.
reparented_countint32reparented_count is the number of direct children that were moved.

DenyModelAllowlistEntryRequest

DenyModelAllowlistEntryRequest denies a single pending entry.

FieldTypeLabelDescription
entry_idstringentry_id is the pending ModelAllowlistEntry to deny. Required.
decided_bystringdecided_by is the acting Manager's member id.
reasonstringreason is the optional free-text denial reason.

DenyModelAllowlistEntryResponse

DenyModelAllowlistEntryResponse carries the post-denial entry.

FieldTypeLabelDescription
entryModelAllowlistEntryentry is the entry after transition (approval_status='denied').

DetachToolRequest

FieldTypeLabelDescription
unit_idstring
tool_idstring

DetachToolResponse

FieldTypeLabelDescription
detachedbool

EffectiveConfig

EffectiveConfig is the per-axis resolved config for a (member/unit) context.

FieldTypeLabelDescription
guardrailsEffectiveGuardrailrepeatedguardrails are PUSH-inherited across home ∪ relation edges (mandatory).
toolsEffectiveItemrepeatedtools are home inherit_down ∪ accepted cross offers.
mcpEffectiveItemrepeatedmcp are home inherit ∪ accepted cross offers.
knowledgeEffectiveItemrepeatedknowledge are home inherit ∪ accepted cross offers.

EffectiveGuardrail

EffectiveGuardrail is a resolved guardrail rule with its severity + action.

FieldTypeLabelDescription
item_idstringitem_id is the canonical rule id "action_type
action_typestringaction_type is the guarded action (parsed from item_id).
targetstringtarget is the guarded target (parsed from item_id).
severitystringseverity is the most-restrictive band across all sources ("low"
sourcesProvenancerepeatedsources are the contributing units (union, all retained).

EffectiveItem

EffectiveItem is a resolved tool / MCP / knowledge item with provenance.

FieldTypeLabelDescription
item_idstringitem_id is the axis-specific opaque id (tool_id
sourcesProvenancerepeatedsources are the contributing units (union, all retained).

EffectiveToolBinding

FieldTypeLabelDescription
bindingToolBinding
effective_sourcestring
source_unit_idstring

GetTeamModelAllowlistRequest

FieldTypeLabelDescription
unit_idstringunit_id is the org_unit (team) id.

GetTeamModelAllowlistResponse

FieldTypeLabelDescription
entriesModelAllowlistEntryrepeatedentries is the current allowlist; empty = allow all.

GetTreeRequest

FieldTypeLabelDescription
org_idstringorg_id is the tenant organisation UUID.
root_idstringroot_id optionally roots the tree at a specific unit; empty = all roots.
max_depthint32max_depth limits the depth relative to the root; 0 = unlimited.

GetTreeResponse

FieldTypeLabelDescription
nodesTreeNoderepeatednodes is the flat list ordered root→children depth-first.
total_unitsint32total_units is the count of nodes returned.

GetUnitManagerRequest

FieldTypeLabelDescription
unit_idstring

GetUnitManagerResponse

FieldTypeLabelDescription
manager_member_idstringmanager_member_id is empty when the unit has no assigned Manager.

GetUnitRequest

FieldTypeLabelDescription
idstringid is the unit UUID.

GetUnitResponse

FieldTypeLabelDescription
unitUnitunit is the requested unit (includes direct_child_count).

ListMembershipsForMemberRequest

FieldTypeLabelDescription
member_idstringmember_id is the UUID of the member.

ListMembershipsForMemberResponse

FieldTypeLabelDescription
membershipsMembershiprepeatedmemberships is the full list (no pagination — typical members belong to <20 units).

ListMembershipsForUnitRequest

FieldTypeLabelDescription
unit_idstringunit_id is the UUID of the unit.
page_sizeint32page_size is the maximum number of results per page; default 50, max 100.
page_tokenint32page_token is the 0-based offset.

ListMembershipsForUnitResponse

FieldTypeLabelDescription
membershipsMembershiprepeatedmemberships is the page of memberships for the unit.
total_countint32total_count is the total matching memberships.

ListOffersRequest

FieldTypeLabelDescription
unit_idstring
kindOfferKind

ListOffersResponse

FieldTypeLabelDescription
offersOfferrepeated

ListPendingModelAllowlistEntriesRequest

ListPendingModelAllowlistEntriesRequest scopes the inbox to a Manager.

FieldTypeLabelDescription
manager_member_idstringmanager_member_id selects the pending entries of the teams this member manages (org_units.manager_member_id). Required.

ListPendingModelAllowlistEntriesResponse

ListPendingModelAllowlistEntriesResponse returns the Manager's pending model-approval queue.

FieldTypeLabelDescription
entriesModelAllowlistEntryrepeatedentries are the pending entries awaiting this Manager's decision, oldest-first.

ListTeamModelsRequest

ListTeamModelsRequest asks for a team's selectable model set.

FieldTypeLabelDescription
unit_idstringunit_id is the org_unit (team) id whose effective model set is resolved. Required.

ListTeamModelsResponse

ListTeamModelsResponse carries the effective, catalogue-enriched model set.

FieldTypeLabelDescription
modelsTeamModelrepeatedmodels is the selectable set: the team's approved allowlist enriched from the catalogue, OR — when the approved set is empty — the full tenant provider-backed catalogue. Deterministically ordered (provider, then model_id) so the picker is stable.
restrictedboolrestricted is true when the team has a non-empty approved allowlist (the returned set IS the allowlist). False when the allowlist is empty and the full catalogue was returned as the fallback.

ListToolsForMemberRequest

FieldTypeLabelDescription
member_idstring

ListToolsForMemberResponse

FieldTypeLabelDescription
bindingsEffectiveToolBindingrepeated

ListToolsForUnitRequest

FieldTypeLabelDescription
unit_idstring

ListToolsForUnitResponse

FieldTypeLabelDescription
bindingsToolBindingrepeated

ListUnitAdminsRequest

FieldTypeLabelDescription
unit_idstring

ListUnitAdminsResponse

FieldTypeLabelDescription
manager_member_idstring
adminsUnitAdminrepeated

ListUnitRelationsRequest

FieldTypeLabelDescription
unit_idstring

ListUnitRelationsResponse

FieldTypeLabelDescription
parentsUnitRelationrepeatedparents are edges where unit_id is the child (its additional parents).
childrenUnitRelationrepeatedchildren are edges where unit_id is the parent.

ListUnitsRequest

FieldTypeLabelDescription
org_idstringorg_id is the tenant organisation UUID.
parent_id_filterstringparent_id_filter restricts results to children of this parent; empty = no filter.
unit_type_filterstringunit_type_filter restricts results to a unit_type; empty = all types.
page_sizeint32page_size is the maximum number of results per page; default 50, max 100.
page_tokenint32page_token is the 0-based offset.

ListUnitsResponse

FieldTypeLabelDescription
unitsUnitrepeatedunits is the page of units.
total_countint32total_count is the total matching units.

MarkShareableRequest

FieldTypeLabelDescription
unit_idstring
kindOfferKind
item_idstringitem_id is the tool_id
shareablebool

MarkShareableResponse

FieldTypeLabelDescription
shareablebool

Membership

Membership is the wire form of an org_unit_memberships row.

FieldTypeLabelDescription
idstringid is the stable UUID of the membership row.
org_idstringorg_id is the tenant organisation UUID.
member_idstringmember_id is the UUID of the member.
unit_idstringunit_id is the UUID of the unit.
unit_namestringunit_name is a denormalised helper populated by ListMembershipsForMember.
rolestringrole is one of member
created_atgoogle.protobuf.Timestampcreated_at is the membership creation timestamp.

MergeUnitsRequest

MergeUnitsRequest folds source_id into target_id.

FieldTypeLabelDescription
source_idstringsource_id is the UUID of the unit being absorbed. Soft-deleted at end of merge.
target_idstringtarget_id is the UUID of the unit receiving source's children + memberships.
conflict_policyConflictPolicyconflict_policy decides how name collisions on direct children of source vs target are resolved. UNSPECIFIED = RENAME.

MergeUnitsResponse

MergeUnitsResponse describes the post-merge state of target plus a per-conflict ledger so the UI can surface which children were renamed / skipped / overwritten.

FieldTypeLabelDescription
merged_unitUnitmerged_unit is the post-merge state of target_id (children + memberships are now its own).
source_deleted_atgoogle.protobuf.Timestampsource_deleted_at is the soft-delete timestamp on source_id.
children_movedint32children_moved is the count of source's direct children that were reparented to target (not including those skipped or overwritten).
memberships_movedint32memberships_moved is the count of org_unit_memberships rows whose unit_id was rewritten from source to target.
conflicts_resolvedConflictResolutionrepeatedconflicts_resolved is the per-name-collision audit ledger.

ModelAllowlistEntry

ModelAllowlistEntry records that a model_id is permitted for the team.

FieldTypeLabelDescription
unit_idstringunit_id is the org_unit (team) id.
model_idstringmodel_id is the canonical model identifier from the ModelRegistry catalogue (e.g. "claude-sonnet-4-20250514").
created_atgoogle.protobuf.Timestampcreated_at is the row creation timestamp.
entry_idstringentry_id is the row id — the target of ApproveModelAllowlistEntry / DenyModelAllowlistEntry. Added by #1705.
approval_statusstringapproval_status is the per-team model approval gate (T6/#1689 + #1705): pending
configured_bystringconfigured_by is the member who proposed the entry (audit actor).
decided_bystringdecided_by is the Manager who approved/denied it; empty until decided.
decided_atgoogle.protobuf.Timestampdecided_at is the decision timestamp; unset until decided.
decision_reasonstringdecision_reason is the optional free-text reason (esp. for a denial).

MoveUnitRequest

FieldTypeLabelDescription
idstringid is the unit UUID to reparent.
new_parent_idstringnew_parent_id is the new parent UUID; empty = make root.

MoveUnitResponse

FieldTypeLabelDescription
unitUnitunit is the moved unit with recomputed ancestor_path and depth.
cascaded_countint32cascaded_count is the number of descendants whose paths were recomputed.

Offer

Offer is a shareable item offered by another unit.

FieldTypeLabelDescription
from_unit_idstring
kindOfferKind
item_idstring
acceptedboolaccepted is true when unit_id already holds an accepted-offer row for it.

Provenance

Provenance names one contributing unit for a resolved item (FR-23 explain view). Every effective item carries one Provenance per contributing source.

FieldTypeLabelDescription
source_unit_idstringsource_unit_id is the org_unit the item is attached to (its origin).
source_unit_namestringsource_unit_name is the display name of source_unit_id (enrichment).
viaProvenanceViavia is the edge the item travelled (HOME chain vs cross RELATION).
pathstringrepeatedpath is the unit-id chain from the source unit down to the active team, for rendering the inheritance route in the explain view.
accepted_from_unit_idstringaccepted_from_unit_id is set ONLY for an accepted cross-cutting offer: the HOME unit that opted in via unit_accepted_offers (two-sided OFFER→ACCEPT). Empty for home-chain items and mandatory guardrail pushes.

PublishGovernedUnitOpRequest

FieldTypeLabelDescription
draft_idstring

PublishGovernedUnitOpResponse

FieldTypeLabelDescription
statusGovernedOpStatus
op_typestringop_type is the applied op (relate
approval_idstring

RejectUnitAdminRequest

FieldTypeLabelDescription
draft_idstring
reasonstring

RejectUnitAdminResponse

FieldTypeLabelDescription
rejectedbool

RemoveMemberRequest

FieldTypeLabelDescription
member_idstringmember_id is the UUID of the member.
unit_idstringunit_id is the UUID of the unit.

RemoveMemberResponse

FieldTypeLabelDescription
removedboolremoved is true when a row was actually deleted.

RemoveUnitAdminRequest

FieldTypeLabelDescription
unit_idstring
member_idstring

RemoveUnitAdminResponse

FieldTypeLabelDescription
removedbool

RemoveUnitRelationRequest

FieldTypeLabelDescription
parent_unit_idstring
child_unit_idstring

RemoveUnitRelationResponse

FieldTypeLabelDescription
statusGovernedOpStatus
draft_idstring
approval_idstring
removedboolremoved is true when status == APPLIED and an edge was soft-deleted.

RequestToolOverrideRequest

FieldTypeLabelDescription
parent_unit_idstring
child_unit_idstring
tool_idstring
child_config_jsonstring
justificationstring
requested_bystring

RequestToolOverrideResponse

FieldTypeLabelDescription
conflictToolConfigConflict

ResolveEffectiveConfigForMemberRequest

FieldTypeLabelDescription
org_idstring
member_idstring
active_unit_idstringactive_unit_id is the team context to resolve in. For an agent this is its single home team.

ResolveEffectiveConfigForMemberResponse

FieldTypeLabelDescription
configEffectiveConfig
multi_parent_activebool

ResolveEffectiveConfigRequest

FieldTypeLabelDescription
org_idstring
unit_idstringunit_id is the team whose effective config to resolve (treated as the active team).

ResolveEffectiveConfigResponse

FieldTypeLabelDescription
configEffectiveConfig
multi_parent_activeboolmulti_parent_active reflects the orgv24.multiparent_resolver read-switch state that produced this result (false ⇒ v2.3-equivalent home-only output).

ResolveToolOverrideRequest

FieldTypeLabelDescription
conflict_idstring
approvebool
notestring
resolved_bystring

ResolveToolOverrideResponse

FieldTypeLabelDescription
conflictToolConfigConflict
bindingToolBinding

RouteTeamRequest

FieldTypeLabelDescription
org_idstringorg_id is the tenant organisation UUID.
intent_tagsstringrepeatedintent_tags are the Task's classified intent tags (e.g. ["billing", "refund"]). Matched case-insensitively against team domain/capabilities.

RouteTeamResponse

FieldTypeLabelDescription
team_idstringteam_id is the org_unit id of the matched team.

SetHomeParentRequest

FieldTypeLabelDescription
unit_idstring
new_parent_idstringnew_parent_id is the target HOME parent; empty promotes the unit to a root.

SetHomeParentResponse

FieldTypeLabelDescription
unitUnit

SetTeamModelAllowlistRequest

FieldTypeLabelDescription
unit_idstringunit_id is the org_unit (team) id.
model_idsstringrepeatedmodel_ids is the full replacement set. Empty = no restriction.
configured_bystringconfigured_by is the caller's member id, carried explicitly per the orgunit service convention (matches AttachTool's configured_by field).

SetTeamModelAllowlistResponse

FieldTypeLabelDescription
entriesModelAllowlistEntryrepeatedentries is the persisted list after replacement.

SetUnitManagerRequest

FieldTypeLabelDescription
unit_idstring
new_manager_member_idstring

SetUnitManagerResponse

FieldTypeLabelDescription
statusGovernedOpStatus
draft_idstring
approval_idstring
manager_member_idstringmanager_member_id echoes the applied Manager when status == APPLIED.

SplitUnitRequest

SplitUnitRequest creates a new sibling unit under source's parent and moves the requested members across.

FieldTypeLabelDescription
source_idstringsource_id is the UUID of the existing unit being split.
new_unit_namestringnew_unit_name is the display name for the freshly created sibling.
member_idsstringrepeatedmember_ids is the list of member UUIDs to move from source to the new unit. Must contain at least one id. Members not currently in source are silently ignored (idempotent).

SplitUnitResponse

SplitUnitResponse returns both units after the split commits.

FieldTypeLabelDescription
originalUnitoriginal is the post-split state of source (members moved out).
new_unitUnitnew_unit is the freshly created sibling of source (members moved in).
memberships_movedint32memberships_moved is the count of org_unit_memberships rows whose unit_id was rewritten from source to new_unit.

TeamModel

TeamModel is one EFFECTIVE, selectable model for a team (#2008). Unlike ModelAllowlistEntry (which mirrors a raw allowlist row and includes the approval axis) this is the resolved, catalogue-enriched view the model picker renders: only approved / provider-backed models, each with the provider + display_name the catalogue carries.

FieldTypeLabelDescription
model_idstringmodel_id is the canonical model identifier (e.g. "claude-sonnet-4-20250514").
providerstringprovider is the LLM provider ("anthropic", "openai", "google", "ollama"). Sourced from the platform seed catalogue; empty when the id is in the team's approved allowlist but absent from the catalogue (see is_known).
display_namestringdisplay_name is the human-readable model name for UI display. Falls back to model_id when the id is not in the catalogue.
is_defaultboolis_default is true for the entry that matches the agent-configuration default model (claude-sonnet-4-20250514) — the value the picker preselects.
is_knownboolis_known is false when the model_id came from the team's approved allowlist but is NOT in the current platform catalogue (a stale/removed model). The UI renders these with an "unknown model" marker. Always true for the empty-allowlist fallback (every entry is a live catalogue model).

ToolBinding

ToolBinding is the wire form of an org_unit_tools row.

FieldTypeLabelDescription
idstring
org_idstring
unit_idstring
tool_idstring
config_jsonstring
visibilitystring
configured_bystring
created_atgoogle.protobuf.Timestamp
updated_atgoogle.protobuf.Timestamp

ToolConfigConflict

FieldTypeLabelDescription
idstring
org_idstring
tool_idstring
parent_unit_idstring
child_unit_idstring
parent_config_jsonstring
child_config_jsonstring
justificationstring
statusstring
requested_bystring
resolution_override_granted_bystring
resolution_notestring
created_atgoogle.protobuf.Timestamp
resolved_atgoogle.protobuf.Timestamp

TreeNode

TreeNode is the flat-list form used by GetTree. Callers reconstruct a nested tree from (id, parent_id, depth).

FieldTypeLabelDescription
idstringid is the UUID of the unit.
parent_idstringparent_id is empty for roots.
namestringname is the display name.
unit_typestringunit_type is "pillar"
depthint32depth is the tree depth (0 for roots).
direct_child_countint32direct_child_count is the number of immediate children.

Unit

Unit is the wire form of an org_units row.

FieldTypeLabelDescription
idstringid is the stable UUID of the unit.
org_idstringorg_id is the tenant organisation UUID.
parent_idstringparent_id is the UUID of the parent unit; empty for roots.
namestringname is the display name of the unit.
unit_typestringunit_type is one of "pillar"
ancestor_pathstringrepeatedancestor_path is the materialised chain of ancestor UUIDs ordered root→parent (NOT including this unit's own id).
depthint32depth is len(ancestor_path). 0 for roots.
direct_child_countint32direct_child_count is the count of non-deleted immediate children (populated by GetUnit and tree queries only; zero elsewhere).
created_atgoogle.protobuf.Timestampcreated_at is the row creation timestamp.
updated_atgoogle.protobuf.Timestampupdated_at is the last update timestamp (mutated by triggers + service writes).
deleted_atgoogle.protobuf.Timestampdeleted_at is set when the unit is soft-deleted; null for active units.
domainstringdomain is the routing domain a team unit handles (e.g. "billing", "support"). Empty for units that opt out of metadata routing. MVP work-routing (#1234, ADR-0015): the deterministic matcher prefers a team whose domain equals one of a Task's intent tags. Meaningful only for unit_type=team; empty on pillars.
capabilitiesstringrepeatedcapabilities are free-form capability tags a team unit can service (e.g. ["refund", "invoice"]). The matcher scores capability overlap with a Task's intent tags below a domain match. Order is not significant.

UnitAdmin

UnitAdmin is one admin entry (active membership or pending appointment).

FieldTypeLabelDescription
unit_idstring
member_idstring
stateAdminAppointmentState
draft_idstringdraft_id / approval_id are populated for PENDING appointments.
approval_idstring
appointed_atgoogle.protobuf.Timestamp

UnitRelation

UnitRelation is the wire form of a unit_relations edge (additional parent).

FieldTypeLabelDescription
idstring
org_idstring
parent_unit_idstring
child_unit_idstring
labelstringlabel is free-text display only, ZERO behaviour (FR-5).
created_bystring
created_atgoogle.protobuf.Timestamp

UpdateUnitRequest

FieldTypeLabelDescription
idstringid is the unit UUID.
namestringname is the new name; empty = no change.
unit_typestringunit_type is the new unit_type; empty = no change.
domainstringdomain sets the team-routing domain; empty = no change (#1234).
capabilitiesstringrepeatedcapabilities replaces the unit's capability tag set when update_capabilities is true; ignored otherwise (#1234).
update_capabilitiesboolupdate_capabilities, when true, replaces capabilities with the supplied list (an empty list clears them). When false, capabilities are left unchanged so a caller can update only name/domain without wiping them.

UpdateUnitResponse

FieldTypeLabelDescription
unitUnitunit is the updated unit.

AdminAppointmentState

AdminAppointmentState distinguishes a live admin (full config powers) from a pending appointment (ZERO powers until the Manager approves — FR-31).

NameNumberDescription
ADMIN_APPOINTMENT_STATE_UNSPECIFIED0UNSPECIFIED — zero value; never emitted.
ADMIN_APPOINTMENT_STATE_ACTIVE1ACTIVE — role=admin membership written; full config powers.
ADMIN_APPOINTMENT_STATE_PENDING2PENDING — appointment awaiting Manager approval; ZERO powers (FR-31).

ConflictPolicy

ConflictPolicy decides how MergeUnits resolves child-name collisions when two children of source + target share a name.

NameNumberDescription
CONFLICT_POLICY_UNSPECIFIED0CONFLICT_POLICY_UNSPECIFIED is the zero value; the server treats it as RENAME so callers that forget to set it get the safe behaviour.
CONFLICT_POLICY_RENAME1CONFLICT_POLICY_RENAME appends a suffix to the moved child's name (e.g. " (merged)") so both rows survive. Default behaviour.
CONFLICT_POLICY_SKIP2CONFLICT_POLICY_SKIP leaves the moved child under source (it is NOT moved to target) so the existing target child wins. The source child is soft-deleted along with the source unit at the end of the merge.
CONFLICT_POLICY_OVERWRITE3CONFLICT_POLICY_OVERWRITE soft-deletes the existing target child before the moved child takes its place. The overwritten child's descendants are also soft-deleted (cascade via existing trigger semantics — this is the destructive option).

GovernedOpStatus

GovernedOpStatus is the lifecycle state of a governed unit op (relation / Manager reassign / admin appointment).

NameNumberDescription
GOVERNED_OP_STATUS_UNSPECIFIED0UNSPECIFIED — zero value; never emitted.
GOVERNED_OP_STATUS_APPLIED1APPLIED — auto-approved (actor manages both endpoints / is the Manager) and physically published.
GOVERNED_OP_STATUS_PENDING_APPROVAL2PENDING_APPROVAL — a resource-scoped approval was opened; the physical write is deferred to PublishGovernedUnitOp once granted.
GOVERNED_OP_STATUS_REJECTED3REJECTED — the op was denied or its approval expired/denied.

OfferKind

OfferKind is the capability axis of a cross-cutting offer.

NameNumberDescription
OFFER_KIND_UNSPECIFIED0UNSPECIFIED — zero value; never emitted.
OFFER_KIND_TOOL1TOOL — an org_unit_tools attachment.
OFFER_KIND_MCP2MCP — an mcp_servers attachment.
OFFER_KIND_KNOWLEDGE3KNOWLEDGE — a knowledge_source_units attachment.

ProvenanceVia

ProvenanceVia is the inheritance edge an item travelled to reach the resolved context: a HOME-chain (parent_id) edge or a cross-cutting RELATION edge.

NameNumberDescription
PROVENANCE_VIA_UNSPECIFIED0UNSPECIFIED — zero value; never emitted.
PROVENANCE_VIA_HOME1HOME — inherited down the active team's HOME (parent_id) chain.
PROVENANCE_VIA_RELATION2RELATION — crossed an additional-parent (unit_relations) edge.

OrgUnitService

OrgUnitService manages the flexible org_units tree and memberships.

--- Unit CRUD ---

Method NameRequest TypeResponse TypeDescription
CreateUnitCreateUnitRequestCreateUnitResponseCreateUnit creates a new org_unit under an optional parent. Triggers compute ancestor_path/depth and guard against cycles. Requires pillars.edit (unit_type=pillar) or teams.edit (unit_type=team) — equivalently, org_units.create once the RBAC seed flips catalog.
GetUnitGetUnitRequestGetUnitResponseGetUnit retrieves a single unit with its ancestor_path, depth, and direct_child_count (helper for UI rendering).
UpdateUnitUpdateUnitRequestUpdateUnitResponseUpdateUnit renames or retypes a unit. Does NOT change parent; use MoveUnit for reparenting so trigger cascade semantics stay explicit.
DeleteUnitDeleteUnitRequestDeleteUnitResponseDeleteUnit soft-deletes a unit. When reparent_children=true direct children are moved up to the deleted unit's parent; otherwise the RPC returns FAILED_PRECONDITION if any direct children exist.
ListUnitsListUnitsRequestListUnitsResponseListUnits returns paginated units for the org, optionally filtered by parent_id or unit_type.
GetTreeGetTreeRequestGetTreeResponseGetTree returns a flat, depth-first list of units rooted at root_id (or org roots when empty). max_depth=0 means unlimited.
MoveUnitMoveUnitRequestMoveUnitResponseMoveUnit reparents a unit. Descendants' ancestor_path and depth are recomputed in the same transaction by migration 060's AFTER trigger. Returns INVALID_ARGUMENT when the move would create a cycle.
MergeUnitsMergeUnitsRequestMergeUnitsResponseMergeUnits atomically folds source_id into target_id: every active child of source becomes a child of target (subject to conflict_policy for name collisions), every active membership of source moves to target, and source is soft-deleted. The operation runs inside the gateway-supplied scope tx so partial failure rolls back atomically. Both units must belong to the caller's org. GAP-V2-8 (#1064).
SplitUnitSplitUnitRequestSplitUnitResponseSplitUnit creates a new sibling unit under the same parent as source_id, then moves the requested member_ids from source to the new unit. The remainder stays in source. The operation runs in a single tx. The new unit inherits source's unit_type. GAP-V2-9 (#1064).
AssignMemberAssignMemberRequestAssignMemberResponseAssignMember upserts a member→unit membership with role (member
RemoveMemberRemoveMemberRequestRemoveMemberResponseRemoveMember removes a member from a unit. Idempotent — returns removed=false when no membership existed.
ListMembershipsForMemberListMembershipsForMemberRequestListMembershipsForMemberResponseListMembershipsForMember returns every unit a member belongs to, including the role in that unit.
ListMembershipsForUnitListMembershipsForUnitRequestListMembershipsForUnitResponseListMembershipsForUnit returns every member assigned to a unit.
AttachToolAttachToolRequestAttachToolResponseAttachTool attaches a tool to an org_unit with a visibility mode. Configure-time subset validation: if an ancestor has the same tool attached with visibility=inherit_down and a more-restrictive config, the RPC returns INVALID_ARGUMENT.
DetachToolDetachToolRequestDetachToolResponseDetachTool soft-deletes a (unit, tool) attachment.
ListToolsForUnitListToolsForUnitRequestListToolsForUnitResponseListToolsForUnit returns the tool attachments configured directly on a unit (no inheritance resolution).
ListToolsForMemberListToolsForMemberRequestListToolsForMemberResponseListToolsForMember returns the effective tool set visible to a member: direct ∪ ancestor-inherit_down ∪ sibling-shared_siblings
RequestToolOverrideRequestToolOverrideRequestRequestToolOverrideResponseRequestToolOverride opens a tool_config_conflicts row asking an approver to allow a child unit's desired config that violates the parent's inherit_down subset rule.
ResolveToolOverrideResolveToolOverrideRequestResolveToolOverrideResponseResolveToolOverride approves or rejects an override request.
SetTeamModelAllowlistSetTeamModelAllowlistRequestSetTeamModelAllowlistResponseSetTeamModelAllowlist replaces the full set of allowed model_ids for a team (unit_type=team). Passing an empty model_ids list clears the allowlist (which means "allow all models the tenant has providers for" — the BYOA AI gateway enforces the provider side separately).

Requires team_models.manage with ScopeOrgUnit of the unit. | | GetTeamModelAllowlist | GetTeamModelAllowlistRequest | GetTeamModelAllowlistResponse | GetTeamModelAllowlist returns the current allowlist for a team. An empty model_ids list means "no restriction — allow all". | | ListTeamModels | ListTeamModelsRequest | ListTeamModelsResponse | ListTeamModels returns the EFFECTIVE, selectable model set for a team — the source of truth the "Create Workflow" wizard's model picker binds to (#2008). It resolves the team's status='approved' allowlist and enriches each id with provider/display_name from the platform seed catalogue. An EMPTY approved set means "no restriction", so it falls back to the whole tenant provider-backed catalogue — identical semantics to the AI Gateway's Allowed() check (migrations 072/129). is_default marks the entry that matches the agent-configuration default model. Read-only; requires teams.view (a team-scoped read, no more sensitive than GetTeamModelAllowlist). | | ListPendingModelAllowlistEntries | ListPendingModelAllowlistEntriesRequest | ListPendingModelAllowlistEntriesResponse | ListPendingModelAllowlistEntries returns the pending model-allowlist entries across every team the given Manager manages (org_units.manager_member_id) — the Manager's model-approval inbox. RLS scopes to the caller's org. Mirrors ListPendingMCPServerBindings. | | ApproveModelAllowlistEntry | ApproveModelAllowlistEntryRequest | ApproveModelAllowlistEntryResponse | ApproveModelAllowlistEntry transitions a pending entry to approved, making the model routable by the AI Gateway. ONLY the entry's team Manager may call it. Mirrors ApproveMCPServerBinding. | | DenyModelAllowlistEntry | DenyModelAllowlistEntryRequest | DenyModelAllowlistEntryResponse | DenyModelAllowlistEntry transitions a pending entry to denied (with an optional reason). ONLY the entry's team Manager may call it; the model stays non-routable. Mirrors DenyMCPServerBinding. | | RouteTeam | RouteTeamRequest | RouteTeamResponse | RouteTeam maps a Task's intent tags to the best-fit team org-unit using deterministic domain/capability metadata only (no LLM, no fuzzy match). Precedence: a team whose domain equals one of the intent tags beats a team matched only on capability overlap; among equals, higher overlap wins; ties break on the lexicographically smallest unit id. Returns NOT_FOUND when no team matches and INVALID_ARGUMENT when no intent tags are supplied. Read-only; requires teams.view. | | AddUnitRelation | AddUnitRelationRequest | AddUnitRelationResponse | AddUnitRelation proposes an additional-parent edge (parent → child) in the combined org graph. Validate-time it rejects an edge that would create a cycle in the COMBINED (home parent_id ∪ unit_relations) up-graph (INVALID_ARGUMENT + the offending path). When the acting member manages BOTH endpoint teams it auto-approves and publishes the edge immediately (status APPLIED); otherwise it opens a two-Manager resource-scoped approval (action_type team_relation_change) and returns PENDING_APPROVAL with a draft_id + approval_id. Requires org_units.update. | | RemoveUnitRelation | RemoveUnitRelationRequest | RemoveUnitRelationResponse | RemoveUnitRelation detaches an existing edge from either endpoint (FR-4), via the same two-Manager governance as AddUnitRelation. | | ListUnitRelations | ListUnitRelationsRequest | ListUnitRelationsResponse | ListUnitRelations returns a unit's active additional-parent edges: parents are edges where the unit is the child, children where it is the parent. Read-only; requires org_units.view. | | PublishGovernedUnitOp | PublishGovernedUnitOpRequest | PublishGovernedUnitOpResponse | PublishGovernedUnitOp resumes a pending governed unit op (relate / unrelate / reassign_manager / appoint_admin) once its approval is granted, applying the physical write inside the per-org advisory-locked version transaction. Re-entrant (pull-based resume): a no-op on an already-published draft. | | SetHomeParent | SetHomeParentRequest | SetHomeParentResponse | SetHomeParent reparents a unit's HOME parent (org_units.parent_id). Unlike MoveUnit it also runs the service-level COMBINED-graph cycle check so a reparent that closes a loop THROUGH a relation edge is rejected at validate time (the migration-060 trigger only walks the home tree). Requires org_units.update. | | GetUnitManager | GetUnitManagerRequest | GetUnitManagerResponse | GetUnitManager returns a unit's Manager member id (empty when unassigned). Read-only; requires org_units.view. | | SetUnitManager | SetUnitManagerRequest | SetUnitManagerResponse | SetUnitManager reassigns a unit's Manager. Governed (approval + audit): auto-applies when the actor is the current Manager, otherwise opens a team_manager_reassign approval. Requires org_units.update. | | AppointUnitAdmin | AppointUnitAdminRequest | AppointUnitAdminResponse | AppointUnitAdmin appoints an additional admin. FR-30 privilege validation: the candidate's identity clearance MUST meet the capability-floor matrix (team_edit, knowledge_edit, mcp_configure, tool_config); a failed check is rejected FAILED_PRECONDITION with the missing-privileges list and NO approval is opened. A qualified candidate is appointed with ZERO powers (PENDING) until the Manager approves — auto-applied (ACTIVE) when the actor IS the Manager. Requires org_units.update. | | ApproveUnitAdmin | ApproveUnitAdminRequest | ApproveUnitAdminResponse | ApproveUnitAdmin is the Manager granting a pending admin appointment, writing the role=admin membership. Requires org_units.update. | | RejectUnitAdmin | RejectUnitAdminRequest | RejectUnitAdminResponse | RejectUnitAdmin declines a pending admin appointment. Requires org_units.update. | | RemoveUnitAdmin | RemoveUnitAdminRequest | RemoveUnitAdminResponse | RemoveUnitAdmin removes an active additional admin. Requires org_units.update. | | ListUnitAdmins | ListUnitAdminsRequest | ListUnitAdminsResponse | ListUnitAdmins returns a unit's Manager plus its admins (ACTIVE + PENDING). Read-only; requires org_units.view. | | MarkShareable | MarkShareableRequest | MarkShareableResponse | MarkShareable flips the shareable flag on a unit's tool / MCP / knowledge attachment, offering it cross-cuttingly. Requires org_units.update. | | ListOffers | ListOffersRequest | ListOffersResponse | ListOffers lists shareable items offered by OTHER units for the given kind (candidate offers a unit may accept), each flagged whether already accepted. Read-only; requires org_units.view. | | AcceptOffer | AcceptOfferRequest | AcceptOfferResponse | AcceptOffer accepts a cross-cutting offer, writing unit_accepted_offers so the resolver (W1-B) surfaces the item for the accepting unit. Requires org_units.update. | | DeclineOffer | DeclineOfferRequest | DeclineOfferResponse | DeclineOffer soft-deletes a previously accepted offer. Requires org_units.update. | | ResolveEffectiveConfig | ResolveEffectiveConfigRequest | ResolveEffectiveConfigResponse | ResolveEffectiveConfig resolves the effective per-axis config for ONE team (unit_id treated as the active team): guardrails (PUSH, most-restrictive), tools/MCP/knowledge (home inherit + accepted cross offers), every item carrying provenance. Read-only; requires org_units.view. | | ResolveEffectiveConfigForMember | ResolveEffectiveConfigForMemberRequest | ResolveEffectiveConfigForMemberResponse | ResolveEffectiveConfigForMember resolves effective config for a member in the context of ONE active team (active_unit_id) — the live execution scope for an agent homed in that team (FR-12/FR-24). Read-only; requires members.view. | | AdminResolveAllTeamsUnion | AdminResolveAllTeamsUnionRequest | AdminResolveAllTeamsUnionResponse | AdminResolveAllTeamsUnion is the FR-15 ADMIN/AUDIT-ONLY union across EVERY team the member belongs to — "everything this member could ever touch". It is NEVER the live execution scope; do NOT use it to build an agent's runtime config (use ResolveEffectiveConfigForMember). Read-only; requires members.view. |

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)