v2

latestOpenAPI 3.1.02026-08-05267431678.1 KB
users

Set Active Team Endpoint

Switch the authenticated user's active team.

Delegates the locked membership write and billing-cache invalidation to :func:set_active_team, then reads the activated team back through :func:get_team_response_for_user. Both a revoked membership and a concurrent teardown surface as a single 409 so the frontend has one retry path. Emits a team.activated audit event after the switch commits.

Args: request: {team_id: uuid} — target team to activate. auth: Authenticated user context.

Returns: TeamResponse for the newly active team.

Raises: HTTPException: 409 if the user is not a current member of the target team (or the membership is revoked between the activation and the readback).

post/users/me/active-team

Request body

team_idstring uuid required

Response

Successful Response

idstring required
namestring required
owner_idstring required
payment_planstring required
router_enabledboolean
zero_data_retentionboolean
created_atstring required
updated_atstring required
member_countinteger nullable
current_user_role'owner' | 'billing' | 'admin' | 'editor' | 'viewer'

Team member roles with hierarchical permissions.

Wire DTO mirror of the ORM TeamRoleType enum. Used only for API request/response serialization; authorization decisions route through the ORM matrix (database_tables.permissions), never this enum.

capabilitiesobject nullable