Skip to content

GET   /users

Get all users in the system

Retrieves a list of all users in the system with their details

Authentication Required

Authorization: Bearer {token}   header string

This header is required to access this endpoint

Required Parameters

x-account-id   header string

Account ID for the request

Optional Parameters

Click here to view an exhaustive list of all available parameters
page   query integer

Page number for pagination

pageSize   query integer

Number of users per page

search   query string

Search users by email or name

teamId   query integer

Filter users by team ID

active   query boolean

Filter users by active status

Try it out

Loading...

Output:

Responses

Description

Users retrieved successfully

{
"users": [
{
"id": 0,
"email": "string",
"name": "string",
"active": false,
"teamId": 0,
"phone": "string",
"imgSrc": "string",
"notificationPreferences": {},
"createdBy": "string",
"updatedBy": "string",
"createdAt": "string",
"updatedAt": "string",
"accounts": [
{
"accountId": "string",
"accountName": "string",
"usersPrimaryAccount": false,
"accountAdmin": false
}
],
"flatRolesList": [
"string"
],
"flatPermissionsList": [
"string"
],
"token": "string"
}
],
"totalCount": 0,
"totalPages": 0,
"currentPage": 0
}

References

#/components/parameters/xAccountIdHeader

in: header
name: x-account-id
schema:
type: string
description: Account ID for the request
required: true
example: "2311"

#/components/schemas/User

type: object
properties:
id:
type: integer
description: User ID
email:
type: string
format: email
description: User's email address
name:
type: string
description: Full name of the user
active:
type: boolean
description: Whether the user is active
teamId:
type: integer
description: ID of the team the user belongs to
phone:
type: string
description: User's phone number
imgSrc:
type: string
description: URL to the user's profile image
notificationPreferences:
type: object
description: User's notification preferences
createdBy:
type: string
description: Email of the user who created this user
updatedBy:
type: string
description: Email of the user who last updated this user
createdAt:
type: string
format: date-time
description: Creation timestamp
updatedAt:
type: string
format: date-time
description: Last update timestamp
accounts:
type: array
description: List of accounts the user has access to
items:
type: object
properties:
accountId:
type: string
accountName:
type: string
usersPrimaryAccount:
type: boolean
accountAdmin:
type: boolean
flatRolesList:
type: array
description: List of user roles
items:
type: string
flatPermissionsList:
type: array
description: List of user permissions
items:
type: string
token:
type: string
description: Authentication token (only included in certain responses)

#/components/schemas/Error

type: object
properties:
error:
type: string
description: Error message
status:
type: integer
description: HTTP status code
message:
type: string
description: Detailed error message
description: Error response object
required:
- error

Route Source Code

Check out the source code for this route entrypoint here: /users/route.ts

Or the swagger.yaml spec this documentation was generated from: /users/swagger.yaml