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

# Get Project Users

> Get the users of a project in different orders

Get the users of a project with various filtering and ordering options.

This endpoint allows you to:

* Search users by username
* Order results by different fields (updated\_at, profile\_count, event\_count)
* Control sort direction (ascending or descending)
* Paginate results with limit and offset

The response includes user data along with their profile count and event count for better project insights.


## OpenAPI

````yaml get /api/v1/project/users
openapi: 3.1.0
info:
  title: Memobase API
  summary: APIs for Memobase, a user memory system for LLM Apps
  version: 0.0.40
servers:
  - url: https://api.memobase.dev
  - url: https://api.memobase.cn
security:
  - BearerAuth: []
paths:
  /api/v1/project/users:
    get:
      tags:
        - project
      summary: Get Project Users
      description: Get the users of a project in different orders
      operationId: get_project_users_api_v1_project_users_get
      parameters:
        - name: search
          in: query
          required: false
          schema:
            type: string
            description: Search string in username field
            default: ''
            title: Search
          description: Search string in username field
        - name: order_by
          in: query
          required: false
          schema:
            enum:
              - updated_at
              - profile_count
              - event_count
            type: string
            description: Order by field
            default: updated_at
            title: Order By
          description: Order by field
        - name: order_desc
          in: query
          required: false
          schema:
            type: boolean
            description: Order descending or ascending
            default: true
            title: Order Desc
          description: Order descending or ascending
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            description: Limit the number of results returned
            default: 10
            title: Limit
          description: Limit the number of results returned
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            description: Offset the starting point for pagination
            default: 0
            title: Offset
          description: Offset the starting point for pagination
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectUsersDataResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-code-samples:
        - lang: python
          source: >+
            # To use the Python SDK, install the package:

            # pip install memobase


            from memobase import MemoBaseClient


            memobase = MemoBaseClient(project_url='PROJECT_URL',
            api_key='PROJECT_TOKEN')


            users = memobase.get_all_users(search="", order_by="updated_at",
            order_desc=True, limit=10, offset=0)

          label: Python
        - lang: go
          source: >+
            // To use the Go SDK, install the package:

            // go get
            github.com/memodb-io/memobase/src/client/memobase-go@latest


            import (
                "fmt"
                "log"

                "github.com/memodb-io/memobase/src/client/memobase-go/core"
            )


            func main() {
                projectURL := "YOUR_PROJECT_URL"
                apiKey := "YOUR_API_KEY"
                // Initialize the client
                client, err := core.NewMemoBaseClient(
                    projectURL,
                    apiKey,
                )
                if err != nil {
                    log.Fatalf("Failed to create client: %v", err)
                }

                // Get all users
                users, err := client.GetAllUsers("", "updated_at", true, 10, 0)
                if err != nil {
                    log.Fatalf("Failed to get all users: %v", err)
                }
                fmt.Printf("Found %d users
            ", len(users))

            }

          label: Go
components:
  schemas:
    ProjectUsersDataResponse:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/ProjectUsersData'
            - type: 'null'
          description: Response containing the users
        errno:
          $ref: '#/components/schemas/CODE'
          description: Error code, 0 means success
          default: 0
        errmsg:
          type: string
          title: Errmsg
          description: Error message, empty when success
          default: ''
      type: object
      title: ProjectUsersDataResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ProjectUsersData:
      properties:
        users:
          items: {}
          type: array
          title: Users
          description: The user list
        count:
          type: integer
          title: Count
          description: The user count
          default: 0
      type: object
      required:
        - users
      title: ProjectUsersData
    CODE:
      type: integer
      enum:
        - 0
        - 400
        - 401
        - 403
        - 404
        - 405
        - 409
        - 422
        - 500
        - 501
        - 502
        - 503
        - 504
        - 520
      title: CODE
    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:
    BearerAuth:
      type: http
      scheme: bearer

````