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

# List group members

> List all members of a specific group with their membership details.

**Authorization**: Users can view members of groups they have permission to access.
Permissions are checked via Cerbos policies.

**Member Information**: Returns each member's CPF, display name (if available),
join timestamp, and who added them to the group.

**Use Cases**:
- View team composition
- Audit group membership
- Administrative oversight
- Access control verification

**Sorting**: Members are returned sorted by join date (newest first).



## OpenAPI

````yaml https://raw.githubusercontent.com/prefeitura-rio/heimdall/main/docs/api/openapi.json get /api/v1/groups/{group_name}/members
openapi: 3.1.0
info:
  title: Heimdall Admin Service
  description: >-
    # Heimdall Admin Service API


    A comprehensive admin service for user and group management with
    authorization powered by Cerbos.


    ## Features


    - **User Management**: Automatic user creation from JWT tokens with
    role-based access control

    - **Group Management**: Create, manage, and assign users to groups with
    hierarchical permissions

    - **Role Management**: Define and assign roles to users and groups

    - **Mapping Management**: Configure API endpoint to action mappings for
    authorization

    - **Action Management**: Define available actions for fine-grained
    permission control

    - **Cerbos Integration**: Policy-based authorization with external Cerbos
    service

    - **Audit Logging**: Comprehensive audit trail for all administrative
    operations

    - **Redis Caching**: High-performance caching for frequently accessed data
  version: 1.0.0
servers:
  - url: https://services.pref.rio/heimdall-admin
    description: Production server
  - url: https://services.staging.app.dados.rio/heimdall-admin
    description: Staging server
security: []
tags:
  - name: health
    description: Service health and readiness checks
  - name: users
    description: >-
      User management operations. Users are automatically created from JWT
      tokens.
  - name: groups
    description: >-
      Group management operations. Groups organize users and can have roles
      assigned.
  - name: memberships
    description: Group membership management. Assign and remove users from groups.
  - name: roles
    description: >-
      Role management operations. Roles define permissions that can be assigned
      to users or groups.
  - name: actions
    description: >-
      Action management operations. Actions define the granular permissions
      available in the system.
  - name: mappings
    description: >-
      API endpoint to action mapping configuration. Maps HTTP endpoints to
      authorization actions.
paths:
  /api/v1/groups/{group_name}/members:
    get:
      tags:
        - memberships
      summary: List group members
      description: >-
        List all members of a specific group with their membership details.


        **Authorization**: Users can view members of groups they have permission
        to access.

        Permissions are checked via Cerbos policies.


        **Member Information**: Returns each member's CPF, display name (if
        available),

        join timestamp, and who added them to the group.


        **Use Cases**:

        - View team composition

        - Audit group membership

        - Administrative oversight

        - Access control verification


        **Sorting**: Members are returned sorted by join date (newest first).
      operationId: list_group_members_api_v1_groups__group_name__members_get
      parameters:
        - name: group_name
          in: path
          required: true
          schema:
            type: string
            title: Group Name
      responses:
        '200':
          description: List of group members retrieved successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GroupMemberResponse'
                title: >-
                  Response List Group Members Api V1 Groups  Group Name  Members
                  Get
              example:
                - subject: '12345678901'
                  display_name: João Silva
                  joined_at: '2024-01-15T10:30:00Z'
                  added_by: '98765432109'
                - subject: '23456789012'
                  display_name: Maria Santos
                  joined_at: '2024-01-10T09:15:00Z'
                  added_by: '98765432109'
        '401':
          description: Unauthorized - Invalid or missing JWT token
          content:
            application/json:
              example:
                detail: Could not validate credentials
        '403':
          description: Forbidden - Insufficient permissions to view group members
          content:
            application/json:
              example:
                detail: >-
                  Permission denied to view members of group
                  'engineering_team:backend'
        '404':
          description: Group not found
          content:
            application/json:
              example:
                detail: Group 'unknown-group' not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
          content:
            application/json:
              example:
                detail: 'Failed to retrieve group members: Database connection error'
      security:
        - HTTPBearer: []
components:
  schemas:
    GroupMemberResponse:
      properties:
        subject:
          type: string
          title: Subject
          description: User's CPF (Brazilian tax ID)
          example: '12345678901'
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Name
          description: User's display name if available
          example: João Silva
        joined_at:
          type: string
          title: Joined At
          description: ISO timestamp when the user joined the group
          example: '2024-01-15T10:30:00Z'
        added_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Added By
          description: CPF of the user who added this member
          example: '98765432109'
      type: object
      required:
        - subject
        - joined_at
      title: GroupMemberResponse
      description: Response model for a group member.
      example:
        added_by: '98765432109'
        display_name: João Silva
        joined_at: '2024-01-15T10:30:00Z'
        subject: '12345678901'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````