Docs

List the teams a user belongs to

GET
/users/{user_id}/teams

The user's team roster, ordered by team name. Each entry carries the team's name, so a client renders a page without resolving ids one by one.

This is the N:N roster and it is not lifecycle ownership: the single team that owns the user's lifecycle is reported as metadata.lifecycle_owner_team_id on the user read endpoints. Memberships the user was removed from are not returned.

Authorization

headerAuthorizationBearer <token>

Scope: user.read, team_membership.read

Path Parameters

user_id*string

The unique identifier of the user.

Match^user_[a-zA-Z0-9_-]+$

Query Parameters

limit?integer

Maximum number of items to return.

Range1 <= value <= 100
Default20
page_token?string

Token for fetching the next page of results. Obtain this value from next_page_token in the previous response. Omit to start from the beginning. Its format is opaque and may change between releases.

Response Body

The teams of a user are returned

application/json
  1. response

Paginated list of the teams a user belongs to.

teams*array<>
next_page_token?|

Token to pass as page_token in the next request to fetch the following page. Absent when there are no more results.

Example Request
import { configureZitadel, getApi } from "@zitadel/api/config";// In the browser, through the SDK proxy: the session cookie authenticates the call.const client = getApi(configureZitadel({ projectId: "proj_01KWH1P4MYS7F0N9WD3P2E4YM5" }));const userTeams = await client.listUserTeams("user_01KWH3B72K7M7F0N9WD3P2E4YM");
Example Response
{  "teams": [    {      "id": "string",      "name": "string",      "membership_status": "pending",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "next_page_token": "string"}

Was this helpful?