---
title: "List all groups for a user"
method: GET
path: "/v2/users/{user_id}/groups"
tags: ["Users"]
---

# List all groups for a user

`GET /v2/users/{user_id}/groups`

## Request

- Base URL: `https://api.byndid.com`
- URL: `https://api.byndid.com/v2/users/{user_id}/groups`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/beyondidentity/apis/beyond-identity-secure-workforce-api/docs/v2/users/:user_id/groups/get.ts> (a function with typed inputs; its response is checked against the schema)

To list all groups for a user, send a GET request to
`/v2/users/$USER_ID/groups`.

**NOTE:** This only returns groups that the user is a direct member of.

The response will have up to 1000 items. The response will be empty if the
page size is not specified (i.e., the default). By default, the list is in
ascending order by `create_time`. The maximum and default page sizes are
subject to change.

When paginating, use the `skip` parameter as the offset.

## Path parameters

- `user_id` string, required

## Query parameters

- `page_size` integer
- `skip` integer

## Response `200`

The response is a JSON object with `groups` and `total_size` keys. <br />
  - `groups` is set to an array of group objects containing standard group
    attributes.
  - `total_size` is set to the total number of items matched by the
    list request. If more items are to be returned by the requested
    query, make another request using the `skip` query parameter.

- object: Response for ListUserGroups.
  - `groups` Group[], required: An ordered array of groups corresponding to the request. If the `order_by` query parameter is set, it follows that ordering. If not, groups are ordered by ascending `create_time` by default.
    - `id` string: A unique identifier for the group within a tenant that is automatically generated on creation. This field is immutable and read-only.
    - `create_time` string, date-time: A time value in the ISO8601 combined date and time format that gets generated automatically and represents the time the group gets created. This field is immutable and read-only.
    - `update_time` string, date-time: A time value in the ISO8601 combined date and time format that gets generated automatically and represents the time the group gets updated. This field is read-only.
    - `tenant_id` string: A unique identifier for the group's tenant that is set automatically on creation. This field is immutable and read-only.
    - `name` string: A required unique name for the group within the tenant.
    - `description` string: A required description for the group within the tenant.
    - `source` string: The source that created the group. This field is immutable and read-only.
  - `total_size` integer, required: The total number of results returned by the operation. This value may be larger than the number of resources returned, such as when returning a single page where multiple pages are available.

## Other responses

- `400`: Bad request.
- `401`: Unauthorized.
- `403`: Forbidden.
- `404`: The resource was not found.
- `429`: Rate limit exceeded.
- `500`: Server error.

---

[API](https://skmtc.dev/beyondidentity/apis/beyond-identity-secure-workforce-api.md) - [All operations](https://skmtc.dev/beyondidentity/apis/beyond-identity-secure-workforce-api/llms.txt) - [OpenAPI document](https://skmtc.dev/beyondidentity/apis/beyond-identity-secure-workforce-api/revisions/562e14b2e4ba?raw)
