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

# List organization users

> Retrieve a paginated list of **active users** in the organization.

Only returns users who have accepted invitations and are active members.
For pending invitations, use `GET /admin/invitations`.




## OpenAPI

````yaml /openapi.yaml get /admin/users
openapi: 3.1.0
info:
  title: AsterAgents API
  version: 1.0.0
  description: >
    API for AsterAgents platform operations.


    - **Admin endpoints** (`/admin/*`) require organization admin privileges
    (`org:admin` role)

    - **Agent endpoints** (`/agents`) require agent management permissions or
    `org:admin` role

    - **Knowledge base endpoints** (`/kb/*`) require standard authentication

    - **Skills endpoints** (`/skills/*`) require standard authentication

    - **File endpoints** (`/upload/*`, `/kb/files`, `/skills/files`) require
    standard authentication
  contact:
    name: AsterAgents Support
    url: https://asteragents.com/support
servers:
  - url: https://asteragents.com/api
    description: Production
  - url: http://localhost:3000/api
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Users
    description: Manage active organization users
  - name: Invitations
    description: Manage organization invitations
  - name: Files
    description: Upload and manage files
  - name: Knowledge Bases
    description: Manage knowledge bases and their files
  - name: Knowledge Base Management
    description: Create, update, and delete knowledge bases
  - name: Agents
    description: Create, update, and delete agents
  - name: Agent Tags
    description: Organize agents with tags
  - name: Tools
    description: Discover the tool catalog available to your organization
  - name: Skills
    description: Manage agent skills
  - name: Skill Files
    description: Manage bundled files for skills
  - name: Conversations
    description: Invoke agents and retrieve conversation history and messages
  - name: Scheduled Tasks
    description: Schedule agents to run automatically on a cron schedule
paths:
  /admin/users:
    get:
      tags:
        - Users
      summary: List organization users
      description: |
        Retrieve a paginated list of **active users** in the organization.

        Only returns users who have accepted invitations and are active members.
        For pending invitations, use `GET /admin/invitations`.
      operationId: listUsers
      parameters:
        - name: limit
          in: query
          description: Number of results to return
          schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 100
        - name: offset
          in: query
          description: Number of results to skip for pagination
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: role
          in: query
          description: Filter by organization role
          schema:
            type: string
            enum:
              - org:admin
              - org:member
        - name: orderBy
          in: query
          description: >-
            Sort field and direction (prefix with `-` for descending, `+` for
            ascending)
          schema:
            type: string
            default: '-created_at'
            examples:
              - '-created_at'
              - +email
              - '-last_sign_in_at'
      responses:
        '200':
          description: Successfully retrieved users
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - totalCount
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/User'
                  totalCount:
                    type: integer
                    description: Total number of active users in the organization
              examples:
                success:
                  value:
                    data:
                      - id: user_2ABC123DEF
                        email: john.doe@company.com
                        firstName: John
                        lastName: Doe
                        username: johndoe
                        profileImageUrl: https://img.clerk.com/profile.jpg
                        role: org:admin
                        publicMetadata:
                          department: engineering
                          title: Senior Engineer
                        joinedAt: 1704182400000
                        lastSignInAt: 1705363800000
                        createdAt: 1701417600000
                      - id: user_2XYZ789GHI
                        email: sarah.smith@company.com
                        firstName: Sarah
                        lastName: Smith
                        username: null
                        profileImageUrl: https://img.clerk.com/avatar.jpg
                        role: org:member
                        publicMetadata:
                          department: marketing
                        joinedAt: 1704787200000
                        lastSignInAt: 1705276800000
                        createdAt: 1704787200000
                    totalCount: 15
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    User:
      type: object
      required:
        - id
        - email
        - role
        - profileImageUrl
        - publicMetadata
      properties:
        id:
          type: string
          description: Unique Clerk user identifier
          example: user_2ABC123DEF
        email:
          type: string
          format: email
          description: User's email address
          example: john.doe@company.com
        firstName:
          type: string
          nullable: true
          description: User's first name
          example: John
        lastName:
          type: string
          nullable: true
          description: User's last name
          example: Doe
        username:
          type: string
          nullable: true
          description: User's username
          example: johndoe
        profileImageUrl:
          type: string
          format: uri
          description: URL to user's profile image
          example: https://img.clerk.com/profile.jpg
        role:
          type: string
          description: User's role in the organization
          enum:
            - org:admin
            - org:member
          example: org:admin
        publicMetadata:
          type: object
          description: Organization-scoped user metadata
          additionalProperties: true
          example:
            department: engineering
            title: Senior Engineer
        joinedAt:
          type: integer
          format: int64
          nullable: true
          description: Unix timestamp (milliseconds) when user joined this organization
          example: 1704182400000
        lastSignInAt:
          type: integer
          format: int64
          nullable: true
          description: Unix timestamp (milliseconds) of user's last sign-in
          example: 1705363800000
        createdAt:
          type: integer
          format: int64
          nullable: true
          description: Unix timestamp (milliseconds) when user account was created
          example: 1701417600000
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: Bad Request
        details:
          type: array
          items:
            type: object
            additionalProperties: true
  responses:
    BadRequest:
      description: Bad Request - Invalid parameters or user not part of organization
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: User is not part of any organization
    Forbidden:
      description: Forbidden - User is not an admin in the organization
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 'Unauthorized: User is not an admin in this organization'
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Internal Server Error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        JWT token from Clerk authentication.

        Must be from a user with `org:admin` role.

````