> ## Documentation Index
> Fetch the complete documentation index at: https://ona.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List Members

> Lists and filters organization members with optional pagination.

`Unary` · [`Organizations`](/docs/api-reference/generated/organization/overview)

Lists and filters organization members with optional pagination.

Use this method to:

* View all organization members
* Monitor member activity
* Manage team membership

### Examples

* List active members:

  Retrieves active members with pagination.

  ```yaml theme={null}
  organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
  pagination:
    pageSize: 20
  ```

* List with pagination:

  Retrieves next page of members.

  ```yaml theme={null}
  organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
  pagination:
    pageSize: 50
    token: "next-page-token-from-previous-response"
  ```

## Endpoint

```text theme={null}
POST /api/gitpod.v1.OrganizationService/ListMembers
```

Send a Bearer token as described in [Authentication](/docs/api-reference#authenticate-requests). If your organization uses a custom management-plane domain, replace `https://app.ona.com` with that domain.

## Request example

<CodeGroup>
  ```bash cURL theme={null}
  export ONA_HOST=https://app.ona.com
  export ONA_API_KEY=<your-token>

  curl --request POST \
    --url "$ONA_HOST/api/gitpod.v1.OrganizationService/ListMembers" \
    --header "Authorization: Bearer $ONA_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
    "organizationId": "<organization-id>"
  }'
  ```

  ```python Python theme={null}
  import gitpod.v1.organization_pb2 as organization_pb2
  from ona_sdk import create_client_from_env

  ona = create_client_from_env()
  request = organization_pb2.ListMembersRequest(
      organization_id="<organization-id>",
  )
  response = ona.services.organization.list_members(request)
  print(response)
  ```

  ```typescript TypeScript theme={null}
  import { create } from "@bufbuild/protobuf";
  import { createClientFromEnv } from "@gitpod/sdk";
  import { ListMembersRequestSchema } from "@gitpod/sdk/gitpod/v1/organization_pb";

  async function main() {
    const ona = createClientFromEnv();
    const request = create(ListMembersRequestSchema, {
      organizationId: "<organization-id>",
    });
    const response = await ona.services.organization.listMembers(request);
    console.log(response);
  }

  main().catch(console.error);
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"
  	"log"

  	"connectrpc.com/connect"
  	"github.com/gitpod-io/gitpod-sdk-go/sdk"
  	gitpodpb "github.com/gitpod-io/gitpod-sdk-go/v1"
  )

  func main() {
  	ona, err := sdk.NewFromEnv()
  	if err != nil {
  		log.Fatal(err)
  	}

  	request := connect.NewRequest(&gitpodpb.ListMembersRequest{
  		OrganizationId: "<organization-id>",
  	})
  	response, err := ona.Services.Organization.ListMembers(context.Background(), request)
  	if err != nil {
  		log.Fatal(err)
  	}
  	fmt.Println(response.Msg)
  }
  ```

  ```json Request body theme={null}
  {
    "organizationId": "<organization-id>"
  }
  ```
</CodeGroup>

## Request

`gitpod.v1.ListMembersRequest`

| Field            | Type                                                    | Required | Description                                                                                                                                                                                                                                                                                        |
| ---------------- | ------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pagination`     | [PaginationRequest](#type-gitpod-v1-pagination-request) | No       | pagination contains the pagination options for listing members                                                                                                                                                                                                                                     |
| `organizationId` | string                                                  | Yes      | organization\_id is the ID of the organization to list members for Constraints: `required=true, string.uuid=true`.                                                                                                                                                                                 |
| `filter`         | [Filter](#type-gitpod-v1-list-members-request-filter)   | No       |                                                                                                                                                                                                                                                                                                    |
| `sort`           | [Sort](#type-gitpod-v1-list-members-request-sort)       | No       | sort specifies the order of results. When unspecified, the authenticated user is returned first, followed by other members sorted by name ascending. When an explicit sort is specified, results are sorted purely by the requested field without any special handling for the authenticated user. |
| `count`          | [CountRequest](#type-gitpod-v1-count-request)           | No       | count controls whether the response includes a bounded total count.                                                                                                                                                                                                                                |

## Response

`gitpod.v1.ListMembersResponse`

| Field        | Type                                                               | Required | Description                                                                                                                   |
| ------------ | ------------------------------------------------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `pagination` | [PaginationResponse](#type-gitpod-v1-pagination-response)          | Yes      | pagination contains the pagination options for listing members Constraints: `required=true`.                                  |
| `members`    | array of [OrganizationMember](#type-gitpod-v1-organization-member) | Yes      | members are the members of the organization Constraints: `required=true`.                                                     |
| `count`      | [CountResponse](#type-gitpod-v1-count-response)                    | No       | count is the bounded total count of matching members, present only when requested via CountRequest.include on the first page. |

## Related types

<a id="type-gitpod-v1-count-request" />

<Accordion title="CountRequest">
  CountRequest controls whether the response should include a bounded
  count of matching records.

  `gitpod.v1.CountRequest`

  | Field     | Type    | Required | Description                                                                                                                                                               |
  | --------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `include` | boolean | No       | When true, the first page of results will include a CountResponse with the bounded total. Subsequent pages (requests with a pagination token) will not contain the count. |
</Accordion>

<a id="type-gitpod-v1-count-response" />

<Accordion title="CountResponse">
  CountResponse represents a bounded count of matching records.
  When the actual count exceeds the counting limit, value is capped and
  relation is set to GREATER\_THAN\_OR\_EQUAL.

  `gitpod.v1.CountResponse`

  | Field      | Type                                                             | Required | Description                                                           |
  | ---------- | ---------------------------------------------------------------- | -------- | --------------------------------------------------------------------- |
  | `value`    | integer                                                          | No       | The count of matching records, capped at the server's counting limit. |
  | `relation` | [CountResponseRelation](#enum-gitpod-v1-count-response-relation) | No       | Indicates whether value is the exact total or a lower bound.          |
</Accordion>

<a id="type-gitpod-v1-list-members-request-filter" />

<Accordion title="Filter">
  `gitpod.v1.ListMembersRequest.Filter`

  | Field                     | Type                                                           | Required | Description                                                                                                                                                                      |
  | ------------------------- | -------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `search`                  | string                                                         | No       | search performs case-insensitive search across member name and email Constraints: `string.max_len=256, string.min_len=0`.                                                        |
  | `statuses`                | array of [UserStatus](#enum-gitpod-v1-user-status)             | No       | status filters members by their user status                                                                                                                                      |
  | `roles`                   | array of [OrganizationRole](#enum-gitpod-v1-organization-role) | No       | roles filters members by their organization role                                                                                                                                 |
  | `userIds`                 | array of string                                                | No       | user\_ids filters the response to only members with the specified user IDs Constraints: `repeated.items.string.uuid=true, repeated.max_items=25, repeated.min_items=0`.          |
  | `excludeGroupIds`         | array of string                                                | No       | exclude\_group\_ids excludes members who are already in any of the specified groups Constraints: `repeated.items.string.uuid=true, repeated.max_items=25, repeated.min_items=0`. |
  | `excludeMembersInAnyTeam` | boolean                                                        | No       | exclude\_members\_in\_any\_team excludes members who belong to any team in the organization                                                                                      |
  | `email`                   | string                                                         | No       | email filters members by exact email address, matched case-insensitively Constraints: `string.max_len=320`.                                                                      |
  | `loginProvider`           | [LoginProviderKind](#enum-gitpod-v1-login-provider-kind)       | No       | login\_provider filters members by the exact provider they use to sign in Constraints: `enum.defined_only=true`.                                                                 |
</Accordion>

<a id="type-gitpod-v1-list-members-request-sort" />

<Accordion title="Sort">
  `gitpod.v1.ListMembersRequest.Sort`

  | Field   | Type                                                         | Required | Description |
  | ------- | ------------------------------------------------------------ | -------- | ----------- |
  | `field` | [SortField](#enum-gitpod-v1-list-members-request-sort-field) | No       |             |
  | `order` | [SortOrder](#enum-gitpod-v1-sort-order)                      | No       |             |
</Accordion>

<a id="type-gitpod-v1-organization-member" />

<Accordion title="OrganizationMember">
  `gitpod.v1.OrganizationMember`

  | Field           | Type                                                  | Required | Description                                                                                  |
  | --------------- | ----------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------- |
  | `userId`        | string                                                | Yes      | Constraints: `required=true, string.uuid=true`.                                              |
  | `role`          | [OrganizationRole](#enum-gitpod-v1-organization-role) | Yes      | Constraints: `required=true`.                                                                |
  | `memberSince`   | RFC 3339 timestamp                                    | Yes      | Constraints: `required=true`.                                                                |
  | `avatarUrl`     | string                                                | No       |                                                                                              |
  | `fullName`      | string                                                | Yes      | Constraints: `required=true`.                                                                |
  | `email`         | string                                                | Yes      | Constraints: `required=true`.                                                                |
  | `status`        | [UserStatus](#enum-gitpod-v1-user-status)             | Yes      | Constraints: `required=true`.                                                                |
  | `loginProvider` | string                                                | Yes      | login\_provider is the login provider the user uses to sign in Constraints: `required=true`. |
</Accordion>

<a id="type-gitpod-v1-pagination-request" />

<Accordion title="PaginationRequest">
  `gitpod.v1.PaginationRequest`

  | Field      | Type    | Required | Description                                                                                                                              |
  | ---------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
  | `pageSize` | integer | No       | Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. Constraints: `int32.gte=0, int32.lte=100`. |
  | `token`    | string  | No       | Token for the next set of results that was returned as next\_token of a PaginationResponse                                               |
</Accordion>

<a id="type-gitpod-v1-pagination-response" />

<Accordion title="PaginationResponse">
  `gitpod.v1.PaginationResponse`

  | Field       | Type   | Required | Description                                                                             |
  | ----------- | ------ | -------- | --------------------------------------------------------------------------------------- |
  | `nextToken` | string | No       | Token passed for retrieving the next set of results. Empty if there are no more results |
</Accordion>

<a id="enum-gitpod-v1-count-response-relation" />

<Accordion title="CountResponseRelation">
  | Value                                 | Number | Description                                                                  |
  | ------------------------------------- | -----: | ---------------------------------------------------------------------------- |
  | `COUNT_RESPONSE_RELATION_UNSPECIFIED` |      0 |                                                                              |
  | `COUNT_RESPONSE_RELATION_EQ`          |      1 | The count is equal to the number of matching records.                        |
  | `COUNT_RESPONSE_RELATION_GTE`         |      2 | The actual number of matching records is greater than or equal to the value. |
</Accordion>

<a id="enum-gitpod-v1-list-members-request-sort-field" />

<Accordion title="SortField">
  | Value                    | Number | Description                                         |
  | ------------------------ | -----: | --------------------------------------------------- |
  | `SORT_FIELD_UNSPECIFIED` |      0 |                                                     |
  | `SORT_FIELD_NAME`        |      1 | Sort by member's display name                       |
  | `SORT_FIELD_DATE_JOINED` |      2 | Sort by the date the member joined the organization |
</Accordion>

<a id="enum-gitpod-v1-login-provider-kind" />

<Accordion title="LoginProviderKind">
  LoginProviderKind identifies the provider used to authenticate an account.

  | Value                             | Number | Description |
  | --------------------------------- | -----: | ----------- |
  | `LOGIN_PROVIDER_KIND_UNSPECIFIED` |      0 |             |
  | `LOGIN_PROVIDER_KIND_SSO`         |      1 |             |
  | `LOGIN_PROVIDER_KIND_GITHUB`      |      2 |             |
  | `LOGIN_PROVIDER_KIND_GOOGLE`      |      3 |             |
  | `LOGIN_PROVIDER_KIND_MAGICLINK`   |      4 |             |
</Accordion>

<a id="enum-gitpod-v1-organization-role" />

<Accordion title="OrganizationRole">
  | Value                           | Number | Description |
  | ------------------------------- | -----: | ----------- |
  | `ORGANIZATION_ROLE_UNSPECIFIED` |      0 |             |
  | `ORGANIZATION_ROLE_ADMIN`       |      1 |             |
  | `ORGANIZATION_ROLE_MEMBER`      |      2 |             |
</Accordion>

<a id="enum-gitpod-v1-sort-order" />

<Accordion title="SortOrder">
  | Value                    | Number | Description |
  | ------------------------ | -----: | ----------- |
  | `SORT_ORDER_UNSPECIFIED` |      0 |             |
  | `SORT_ORDER_ASC`         |      1 |             |
  | `SORT_ORDER_DESC`        |      2 |             |
</Accordion>

<a id="enum-gitpod-v1-user-status" />

<Accordion title="UserStatus">
  | Value                     | Number | Description |
  | ------------------------- | -----: | ----------- |
  | `USER_STATUS_UNSPECIFIED` |      0 |             |
  | `USER_STATUS_ACTIVE`      |      1 |             |
  | `USER_STATUS_SUSPENDED`   |      2 |             |
  | `USER_STATUS_LEFT`        |      3 |             |
</Accordion>
