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

# List users by organization

> Retrieve a list of users belonging to the specified organization. Only users within the organization can access the API.



## OpenAPI

````yaml /api-spec/ias-public-api.yaml get /organizations/{orgId}/users
openapi: 3.0.3
info:
  title: IAM Service API
  description: APIs for IAM Service.
  version: 2.4.0
servers:
  - url: https://console.gmicloud.ai/api/v1
    description: IAM Service API
security: []
paths:
  /organizations/{orgId}/users:
    get:
      tags:
        - organizations
      summary: List users by organization
      description: >-
        Retrieve a list of users belonging to the specified organization. Only
        users within the organization can access the API.
      parameters:
        - $ref: '#/components/parameters/orgIdParam'
      responses:
        '200':
          description: Successfully list users by organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/listUsersByOrganizationResponse'
        '400':
          description: |
            - [group:**request**, code:**0**]: Invalid field in the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrStatusMsg'
              examples:
                Invalid field in the request:
                  summary: Invalid field in the request.
                  value:
                    group: request
                    code: 0
                    validationDetail:
                      - field: orgId
                        expression: uuid
                        originalValue: orgId
                        reason: Should be a valid UUID.
                No request body:
                  summary: No request body.
                  value:
                    group: request
                    code: 1
                    message: The request body is required.
        '404':
          description: |
            - [group:**organization**, code:**2**]: Organization does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrStatusMsg'
              examples:
                Organization does not exist:
                  summary: Organization does not exist.
                  value:
                    group: organization
                    code: 2
                    message: Organization does not exist.
        '500':
          description: >
            - [group:**organization**, code:**1200**]: Get organization grouping
            policy encountered error.

            - [group:**organization**, code:**1201**]: Get organization
            encountered DB error.

            - [group:**user**, code:**1200**]: Get user encountered DB error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrStatusMsg'
              examples:
                Get user encountered DB error:
                  summary: Get user encountered DB error.
                  value:
                    group: user
                    code: 1000
                    message: Get user encountered DB error.
                    traces:
                      - DB error occurred.
      security:
        - bearerAuth: []
components:
  parameters:
    orgIdParam:
      name: orgId
      in: path
      schema:
        type: string
        format: uuid
        x-go-type: uuid.UUID
        example: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
      required: true
      description: |
        The organization's ID.
        - Must be a valid UUID.
  schemas:
    listUsersByOrganizationResponse:
      type: object
      properties:
        users:
          type: array
          description: A list of users in the specified organization.
          items:
            $ref: '#/components/schemas/userInOrganization'
    ErrStatusMsg:
      type: object
      properties:
        group:
          type: string
          description: >-
            API function group\n -Will be "request" if there are invalid request
            parameters.
          x-oapi-codegen-extra-tags:
            binding: required
        code:
          type: integer
          description: The substatus error code for the API response.
          x-oapi-codegen-extra-tags:
            binding: required
        message:
          type: string
          description: The substatus error Message for API response.
          x-go-type-skip-optional-pointer: true
        traces:
          type: array
          items:
            type: string
          description: The original error messages.
          x-go-type-skip-optional-pointer: true
        validationDetail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationDetail'
          description: >-
            Returned when there are invalid request
            paremeters(group="request")\n List of invalid fields and the reason
            of error.
          x-go-type-skip-optional-pointer: true
      example:
        group: request
        code: 0
        validationDetail:
          - field: email
            expression: required
            originalValue: ''
            reason: This field is required.
      required:
        - group
        - code
    userInOrganization:
      type: object
      description: Information about a user and their role within the organization.
      properties:
        id:
          type: string
          format: uuid
          x-go-type: uuid.UUID
          description: The user's ID.
          example: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
        email:
          type: string
          description: The user's email address.
          example: john.doe@example.com
        firstName:
          type: string
          description: The user's first name.
          example: john
        lastName:
          type: string
          description: The user's last name.
          example: doe
        lastLoginAt:
          type: integer
          description: >-
            The UNIX timestamp in seconds (UTC) of the user's most recent login.
            (UTC).
          format: int64
          example: 1740557336
        lastLoginIDP:
          type: string
          description: |
            The identity provider used during the user's most recent login.
            - "native": Logged in with username and password.
            - "google": Logged in using Google OAuth.
            - "github": Logged in using GitHub OAuth.
            - "hugging_face": Logged in using Hugging Face OAuth.
          enum:
            - native
            - google
            - github
            - hugging_face
          example: google
          x-go-type: iamLibTypes.OAuthProvider
          x-go-type-import:
            path: us-central1-go.pkg.dev/gmi-cloud-cicd/go-dev/iam-lib-go/pkg/types
            name: iamLibTypes
          x-oapi-codegen-extra-tags:
            binding: required
        orgRole:
          type: string
          enum:
            - org_owner
            - org_user
          x-go-type: ceCommonLibTypes.IasOrganizationRole
          x-go-type-import:
            path: >-
              us-central1-go.pkg.dev/gmi-cloud-cicd/go-dev/ce-common-lib-go/pkg/types
            name: ceCommonLibTypes
          description: The user's organization role.
          example: org_owner
      required:
        - id
        - email
        - firstName
        - lastName
        - orgRole
        - lastLoginAt
        - lastLoginIDP
    ValidationDetail:
      type: object
      properties:
        field:
          type: string
          description: The field of the request data.
          x-go-type-skip-optional-pointer: true
        expression:
          type: string
          description: The form of violation.
          x-go-type-skip-optional-pointer: true
        argument:
          type: string
          description: The number or data to support the expression.
          x-go-type-skip-optional-pointer: true
        originalValue:
          description: The original value from the request.
          x-go-type-skip-optional-pointer: true
        reason:
          type: string
          description: The reason for the validation error.
          x-go-type-skip-optional-pointer: true
      example:
        - field: fieldXXX
          expression: required
          originalValue: ''
          reason: This field is required.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        An access token used to authenticate a user and grant access to
        restricted APIs. It is issued by session APIs.

        For status codes related to this header, refer to the 

        [Common Headers
        Documentation](https://gmicloud.atlassian.net/wiki/spaces/CE/pages/47199534/Common+Headers#Authorization).

````