Skip to main content

Tenant API

Table of Contents

Top

upsquad/tenant/v1/security_config.proto

GetTenantSecurityConfigRequest

GetTenantSecurityConfigRequest is deliberately empty — tenant id is resolved from the authenticated context, never from the body.

GetTenantSecurityConfigResponse

GetTenantSecurityConfigResponse returns the current tenant config.

FieldTypeLabelDescription
configTenantSecurityConfigconfig is the current persisted tenant security config (or platform defaults when no row exists yet).

TenantSecurityConfig

TenantSecurityConfig carries the editable surface for the security pipeline. Tenant id is NOT a field here — it is resolved from the authenticated context (defence against forged-body attacks).

FieldTypeLabelDescription
input_filter_modestringinput_filter_mode controls the pattern-scanner severity for inbound prompts. L5 — posture-changing.
output_filter_modestringoutput_filter_mode controls the pattern-scanner severity for agent outputs. L5 — posture-changing.
redact_secretsboolredact_secrets enables server-side secret redaction in outputs. Turning this OFF is a posture-downgrade — L5 required.
redact_piiboolredact_pii enables PII redaction in outputs.
redact_system_promptboolredact_system_prompt removes the system prompt from agent responses before the client sees them.
schema_validation_modestringschema_validation_mode controls response-schema enforcement: log_only, warn, or block. L4 — tenant can tighten or relax their own enforcement within platform limits.
tool_scan_enabledbooltool_scan_enabled toggles output scanning of tool results. L4 — tenant-scoped operational knob.
tool_result_max_bytesint32tool_result_max_bytes caps the size of tool outputs scanned. Operational knob; L4.
updated_atgoogle.protobuf.Timestampupdated_at — server-stamped; read-only on the surface.

UpdateTenantSecurityConfigRequest

UpdateTenantSecurityConfigRequest carries the desired tenant config.

FieldTypeLabelDescription
configTenantSecurityConfigconfig is the desired tenant security config. All fields are validated; invalid values return InvalidArgument with a FieldViolation[].

UpdateTenantSecurityConfigResponse

UpdateTenantSecurityConfigResponse returns the persisted tenant config.

FieldTypeLabelDescription
configTenantSecurityConfigconfig is the persisted tenant security config after successful Update, including server-stamped updated_at.

TenantSecurityConfigService

TenantSecurityConfigService exposes the per-tenant security pipeline knobs. Tenant scope is sourced from the authenticated context — NEVER from a request field.

Method NameRequest TypeResponse TypeDescription
GetTenantSecurityConfigGetTenantSecurityConfigRequestGetTenantSecurityConfigResponseGetTenantSecurityConfig returns the tenant's current security configuration, or the platform defaults when no row exists. Read clearance L3 (tenant admin) lets an org admin inspect their own posture without being able to change it.
UpdateTenantSecurityConfigUpdateTenantSecurityConfigRequestUpdateTenantSecurityConfigResponseUpdateTenantSecurityConfig replaces the tenant's configuration after validating every field. Emits one config.updated audit event with a field-level diff. L5 clearance required.

Top

upsquad/tenant/v1/tenant.proto

AssignCopilotRequest

AssignCopilotRequest links a user to a personal copilot agent.

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the organisation.
user_idstringuser_id is the UUID of the target user.

AssignCopilotResponse

AssignCopilotResponse returns the copilot assignment result.

FieldTypeLabelDescription
copilot_agent_idstringcopilot_agent_id is the UUID of the assigned copilot agent.
createdboolcreated is true if a new agent was created, false if already assigned.

AssignRoleRequest

AssignRoleRequest changes a user's clearance level.

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the organisation.
user_idstringuser_id is the UUID of the target user.
new_clearanceint32new_clearance is the new clearance level (1-5).
caller_user_idstringcaller_user_id is the UUID of the user performing the assignment (for clearance checks).

AssignRoleResponse

AssignRoleResponse confirms the role change.

FieldTypeLabelDescription
userUseruser contains the updated user record.

BulkImportMembersRequest

BulkImportMembersRequest imports a batch of users.

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the organisation.
caller_user_idstringcaller_user_id is the UUID of the caller (for clearance checks).
formatstringformat is the input format: "csv" or "json".
payloadbytespayload is the raw CSV or JSON data (max 500 rows).

BulkImportMembersResponse

BulkImportMembersResponse returns the import results.

FieldTypeLabelDescription
total_rowsint32total_rows is the number of rows parsed from the payload.
success_countint32success_count is the number of successfully imported rows.
error_countint32error_count is the number of rows that failed.
resultsImportRowResultrepeatedresults is the per-row import result detail.

ConfigureCopilotRequest

ConfigureCopilotRequest sets the copilot persona and/or model.

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the organisation.
user_idstringuser_id is the UUID of the target user.
personastringpersona is the system persona for the copilot (empty = no change).
model_idstringmodel_id is the LLM model ID (empty = no change).

ConfigureCopilotResponse

ConfigureCopilotResponse confirms the copilot configuration update.

FieldTypeLabelDescription
copilot_agent_idstringcopilot_agent_id is the UUID of the configured copilot agent.
updated_atgoogle.protobuf.Timestampupdated_at is the server-side timestamp of the update.

CreateOrganizationRequest

CreateOrganizationRequest provisions a new tenant.

FieldTypeLabelDescription
namestringname is the display name for the organisation.
admin_emailstringadmin_email is the email of the founding admin user.
admin_clerk_user_idstringadmin_clerk_user_id is the Clerk user ID for the admin.
admin_display_namestringadmin_display_name is the display name of the admin user.

CreateOrganizationResponse

CreateOrganizationResponse returns the provisioned org and admin IDs.

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the created organisation.
admin_user_idstringadmin_user_id is the UUID of the admin user record.
default_pillar_idstringdefault_pillar_id is the UUID of the auto-created default pillar.
default_team_idstringdefault_team_id is the UUID of the auto-created default team.
subscription_idstringsubscription_id is the UUID of the free-trial subscription.

DeployTeamFromSuggestionRequest

DeployTeamFromSuggestionRequest deploys a team structure from a suggestion.

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the organisation.
suggestionTeamSuggestionsuggestion is the team structure to deploy.

DeployTeamFromSuggestionResponse

DeployTeamFromSuggestionResponse returns the IDs of all created entities.

FieldTypeLabelDescription
pillar_idsstringrepeatedpillar_ids is the list of created pillar UUIDs.
team_idsstringrepeatedteam_ids is the list of created team UUIDs.
agent_idsstringrepeatedagent_ids is the list of created agent UUIDs.

DisableUserRequest

DisableUserRequest suspends a user (preserves data, blocks access).

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the organisation.
user_idstringuser_id is the UUID of the target user.
caller_user_idstringcaller_user_id is the UUID of the user performing the action (for clearance checks).

DisableUserResponse

DisableUserResponse returns the updated user record.

FieldTypeLabelDescription
userUseruser contains the updated user record with status 'suspended'.

EnableUserRequest

EnableUserRequest activates a user (from suspended or invited).

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the organisation.
user_idstringuser_id is the UUID of the target user.
caller_user_idstringcaller_user_id is the UUID of the user performing the action (for clearance checks).

EnableUserResponse

EnableUserResponse returns the updated user record.

FieldTypeLabelDescription
userUseruser contains the updated user record with status 'active'.

GetOrgHierarchyRequest

GetOrgHierarchyRequest is the input for the GetOrgHierarchy RPC.

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the organisation.

GetOrgHierarchyResponse

GetOrgHierarchyResponse is the output for the GetOrgHierarchy RPC.

FieldTypeLabelDescription
rootOrgHierarchyNoderoot is the top-level organisation node with nested pillar and team children.

GetOrganizationRequest

GetOrganizationRequest retrieves an organisation by ID.

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the organisation.

GetOrganizationResponse

GetOrganizationResponse returns the organisation record.

FieldTypeLabelDescription
organizationOrganizationorganization contains the full organisation record.

GetTeamSuggestionRequest

GetTeamSuggestionRequest asks the AI to suggest a team structure.

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the organisation.

GetTeamSuggestionResponse

GetTeamSuggestionResponse returns the AI-generated team suggestion.

FieldTypeLabelDescription
suggestion_jsonstringsuggestion_json is a JSON-encoded team structure suggestion.

GetUserProfileRequest

GetUserProfileRequest retrieves a full user profile including copilot.

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the organisation.
user_idstringuser_id is the UUID of the target user.

GetUserProfileResponse

GetUserProfileResponse returns the user profile with copilot details.

FieldTypeLabelDescription
userUseruser contains the user record.
copilot_agent_idstringcopilot_agent_id is the UUID of the assigned copilot agent (empty if none).
copilot_personastringcopilot_persona is the copilot's system persona (empty if no copilot).
copilot_model_idstringcopilot_model_id is the copilot's LLM model ID (empty if no copilot).

ImportRowResult

ImportRowResult describes the outcome of a single import row.

FieldTypeLabelDescription
row_numberint32row_number is the 1-based index of the row in the input.
successboolsuccess is true if the row was imported successfully.
errorstringerror is the error message (empty on success).
user_idstringuser_id is the UUID of the created user (populated on success).

InviteUserRequest

InviteUserRequest creates a new user invitation.

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the organisation.
emailstringemail is the invitee's email address.
display_namestringdisplay_name is the invitee's display name.
clearanceint32clearance is the target clearance level (1-5).
pillar_idstringpillar_id optionally assigns the user to a pillar.
team_idstringteam_id optionally assigns the user to a team.
caller_user_idstringcaller_user_id is the UUID of the user performing the invite (for clearance checks).

InviteUserResponse

InviteUserResponse returns the invited user record.

FieldTypeLabelDescription
userUseruser contains the created user record with status 'invited'.

ListUsersRequest

ListUsersRequest lists users in an organisation.

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the organisation.
status_filterstringstatus_filter optionally filters by user status (empty = all non-deleted).
page_sizeint32page_size is the maximum number of results per page. Default 50, max 100.
page_tokenint32page_token is the offset for pagination (0-based).

ListUsersResponse

ListUsersResponse returns the list of users.

FieldTypeLabelDescription
usersUserrepeatedusers is the list of user records.
total_countint32total_count is the total number of matching users.

MoveMemberRequest

MoveMemberRequest reassigns a user to a different pillar and/or team.

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the organisation.
user_idstringuser_id is the UUID of the target user to move.
caller_user_idstringcaller_user_id is the UUID of the caller (for clearance checks).
pillar_idstringpillar_id is the new pillar UUID (empty = no change).
team_idstringteam_id is the new team UUID (empty = no change).

MoveMemberResponse

MoveMemberResponse returns the updated user.

FieldTypeLabelDescription
userUseruser contains the updated user record.

OrgHierarchyNode

OrgHierarchyNode represents a single node in the organisation hierarchy tree. The node_type field indicates whether this is an org, pillar, or team node.

FieldTypeLabelDescription
idstringid is the UUID of the entity (org, pillar, or team).
namestringname is the display name of the entity.
node_typestringnode_type is one of: org, pillar, team.
childrenOrgHierarchyNoderepeatedchildren is the list of child nodes (pillars under org, teams under pillar).

Organization

Organization is the domain object for a tenant organisation.

FieldTypeLabelDescription
idstringid is the UUID primary key.
namestringname is the display name.
onboarding_completedboolonboarding_completed indicates whether onboarding is done.
created_atgoogle.protobuf.Timestampcreated_at is the creation timestamp.

RemoveUserRequest

RemoveUserRequest soft-deletes a user.

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the organisation.
user_idstringuser_id is the UUID of the user to remove.
caller_user_idstringcaller_user_id is the UUID of the user performing the removal (for clearance checks).

RemoveUserResponse

RemoveUserResponse confirms user removal.

FieldTypeLabelDescription
removed_atgoogle.protobuf.Timestampremoved_at is the server-side timestamp of the soft-delete.

SubmitOnboardingQuestionnaireRequest

SubmitOnboardingQuestionnaireRequest persists the onboarding answers.

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the organisation.
answersstringanswers is a JSON-encoded questionnaire response.

SubmitOnboardingQuestionnaireResponse

SubmitOnboardingQuestionnaireResponse confirms the submission.

FieldTypeLabelDescription
okboolok is true when the questionnaire was saved successfully.

SuggestedAgent

SuggestedAgent describes a single agent in a team suggestion.

FieldTypeLabelDescription
namestringname is the agent's display name.
personastringpersona is the agent's system persona prompt.
clearanceint32clearance is the suggested clearance level.
model_idstringmodel_id is the suggested LLM model ID.

SuggestedPillar

SuggestedPillar describes a pillar within a team suggestion.

FieldTypeLabelDescription
namestringname is the pillar's display name.
teamsSuggestedTeamrepeatedteams is the list of teams for this pillar.

SuggestedTeam

SuggestedTeam describes a team within a team suggestion.

FieldTypeLabelDescription
namestringname is the team's display name.
agentsSuggestedAgentrepeatedagents is the list of agents for this team.

TeamSuggestion

TeamSuggestion is the top-level AI-generated team structure.

FieldTypeLabelDescription
pillarsSuggestedPillarrepeatedpillars is the list of suggested pillars.

UpdateOrganizationRequest

UpdateOrganizationRequest patches mutable fields on an organisation.

FieldTypeLabelDescription
org_idstringorg_id is the UUID of the organisation to update.
namestringname is the new display name (empty string = no change).

UpdateOrganizationResponse

UpdateOrganizationResponse returns the updated organisation.

FieldTypeLabelDescription
organizationOrganizationorganization contains the updated organisation record.

User

User is the domain object for a human operator in the tenant.

FieldTypeLabelDescription
idstringid is the UUID primary key.
org_idstringorg_id is the parent organisation UUID.
clerk_user_idstringclerk_user_id is the Clerk authentication user ID.
emailstringemail is the user's email address.
display_namestringdisplay_name is the user's display name.
clearanceint32clearance is the user's clearance level (1-5).
pillar_idstringpillar_id is the assigned pillar UUID (empty if unassigned).
team_idstringteam_id is the assigned team UUID (empty if unassigned).
statusstringstatus is one of: active, invited, suspended, removed.
created_atgoogle.protobuf.Timestampcreated_at is the creation timestamp.

TenantService

TenantService manages organisations, users, and the AI team onboarding flow. Unit-hierarchy mutations (pillars / teams) moved to OrgUnitService in Wave K.1 (#693); this service no longer exposes Pillar/Team CRUD.

--- Organisation lifecycle ---

Method NameRequest TypeResponse TypeDescription
CreateOrganizationCreateOrganizationRequestCreateOrganizationResponseCreateOrganization provisions a new tenant with admin user, default pillar, default team, and a 14-day free-trial subscription in a single transaction.
GetOrganizationGetOrganizationRequestGetOrganizationResponseGetOrganization returns the organisation record for the given ID.
UpdateOrganizationUpdateOrganizationRequestUpdateOrganizationResponseUpdateOrganization patches mutable organisation fields (name, onboarding state).
GetOrgHierarchyGetOrgHierarchyRequestGetOrgHierarchyResponseGetOrgHierarchy returns the full org hierarchy as a tree of pillars and teams. Read-only view composed server-side from the org_units mirror; unit CRUD lives on OrgUnitService.
InviteUserInviteUserRequestInviteUserResponseInviteUser creates an invited user record. Caller clearance must be >= target.
ListUsersListUsersRequestListUsersResponseListUsers returns users in the organisation with optional status filter.
RemoveUserRemoveUserRequestRemoveUserResponseRemoveUser soft-deletes a user (sets deleted_at). Caller clearance must be > target.
AssignRoleAssignRoleRequestAssignRoleResponseAssignRole changes a user's clearance level. Caller must have clearance >= new level AND > the user's current clearance.
EnableUserEnableUserRequestEnableUserResponseEnableUser sets a user's status to active (from suspended or invited). Caller clearance must be > target clearance.
DisableUserDisableUserRequestDisableUserResponseDisableUser sets a user's status to suspended (preserves data, blocks access). Caller clearance must be > target clearance.
AssignCopilotAssignCopilotRequestAssignCopilotResponseAssignCopilot links a user to a personal copilot agent. Creates the agent if no copilot is assigned yet. Idempotent.
ConfigureCopilotConfigureCopilotRequestConfigureCopilotResponseConfigureCopilot sets the copilot's persona and/or model. Returns FailedPrecondition if no copilot is assigned.
GetUserProfileGetUserProfileRequestGetUserProfileResponseGetUserProfile returns the full user record including copilot assignment.
SubmitOnboardingQuestionnaireSubmitOnboardingQuestionnaireRequestSubmitOnboardingQuestionnaireResponseSubmitOnboardingQuestionnaire persists the questionnaire answers on the org.
GetTeamSuggestionGetTeamSuggestionRequestGetTeamSuggestionResponseGetTeamSuggestion calls the Context Engine's AssembleContext with an onboarding persona and the questionnaire answers to produce a suggested AI team structure.
DeployTeamFromSuggestionDeployTeamFromSuggestionRequestDeployTeamFromSuggestionResponseDeployTeamFromSuggestion provisions pillars, teams, agents, and configurations from a previously generated suggestion in a single transaction.
MoveMemberMoveMemberRequestMoveMemberResponseMoveMember reassigns a user to a different pillar and/or team. Caller clearance must be >= target user's clearance.
BulkImportMembersBulkImportMembersRequestBulkImportMembersResponseBulkImportMembers imports a batch of users (up to 500 rows) in a single transaction, returning per-row success/error results.

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)