---
title: "Set Active Team Endpoint"
method: POST
path: "/v1/users/me/active-team"
tags: ["users"]
---

# Set Active Team Endpoint

`POST /v1/users/me/active-team`

## Request

- Base URL: `https://api.pioneer.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pioneer.ai/v1/users/me/active-team`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/pioneer/apis/brain-api/docs/v1/users/me/active-team/post.ts> (a function with typed inputs; its response is checked against the schema)

Switch the caller's active team.

Args:
    request: Target team payload.
    auth: Authenticated caller.
    service: User service.

Returns:
    Activated team.

Raises:
    HTTPException: If membership is revoked.

## Request body

- SetActiveTeamRequest: Request body for POST /users/me/active-team.
  - `team_id` string, uuid, required

## Response `200`

Successful Response

- TeamResponse: Response model for a single team.
  - `id` string, required
  - `name` string, required
  - `owner_id` string, required
  - `zero_data_retention` boolean
  - `created_at` string, required
  - `updated_at` string, required
  - `member_count` integer, 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.
  - `capabilities` object, nullable
  - `max_seats` integer, nullable: Cap on members plus pending invitations. Null means unlimited; a new team opens at the column's fail-closed default of 150 seats.
  - `max_api_keys` integer, nullable: Cap on active user-facing API keys, excluding internal run keys. Null means no team-specific cap, so the platform default applies; 0 forbids API keys.

## Other responses

- `422`: Validation Error

## Changes

- **2026-09-24** `0e5e86e2bae5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/pioneer/apis/brain-api/changes/v1/users/me/active-team/post.md)

---

[API](https://skmtc.dev/pioneer/apis/brain-api.md) - [All operations](https://skmtc.dev/pioneer/apis/brain-api/llms.txt) - [OpenAPI document](https://skmtc.dev/pioneer/apis/brain-api/revisions/0e5e86e2bae5?raw)
