Developers

Search for documents

Dev

Users

Operations related to users

All endpoints require a JWT Bearer token in the Authorization header.

GET /v1/users

Get a list of users with pagination

Parameters

Name

In

Type

Required

Description

limit

query

integer

Yes

Maximum number of records to return. Starts from 1 to 1000.

page

query

integer

Yes

Page number to retrieve, starting from 0.

selectFields

query

string

No

Comma-separated list of specific fields to include in the response. Defaults to all fields. <br>Note: If selectFields is provided, excludeFields will be ignored.

excludeFields

query

string

No

Comma-separated list of fields to exclude from the response. Defaults to all fields.

filter

query

string

No

JSON object representing filter criteria in MongoDB Query Language (MQL) format.

sort

query

string

No

JSON object representing sort criteria in MongoDB Query Language (MQL) format.

populateOptions

query

string

No

A JSON object that specifies how to include related data in query results.

Responses

Status

Description

200

Successfully retrieved a paginated list of users.

POST /v1/users

Create a new user account

Request body (required)

User details

Field

Type

Required

Description

email

string

Yes

User's email address

firstName

string

Yes

User's first name

lastName

string

Yes

User's last name

preferredBranding

string

No

User's preferred branding theme identifier

preferredLanguage

string (enum)

No

User's preferred language for the application UI and localized content

role

string (enum)

Yes

User's role in the system

brand

array<string>

No

List of brand IDs the user belongs to. Must be empty for admin role, at least one for other roles

stores

array<string>

No

List of store IDs the user belongs to. Must be empty for admin and brand admin roles, at least one for other roles

merchants

array<string>

No

List of merchant IDs the user belongs to. Must be empty for admin and brand admin roles, at least one for other roles

Responses

Status

Description

201

User account created successfully

400

Invalid input

401

Invalid token

500

User with this email already exists

PATCH /v1/users/change-password

Change password for authenticated user

Request body (required)

Password change details

Field

Type

Required

Description

currentPassword

string

Yes

User's current password

newPassword

string

Yes

New password (minimum 8 characters)

confirmPassword

string

Yes

Confirmation of new password (must match newPassword)

Responses

Status

Description

200

Password changed successfully

400

Bad Request - Validation error

401

Unauthorized - Invalid or missing token

200 response schema

Field

Type

Required

Description

success

boolean

No


message

string

No


data

null

No


GET /v1/users/{id}

Get a specific user by ID

Parameters

Name

In

Type

Required

Description

id

path

string

Yes

The userId field

selectFields

query

string

No

Comma-separated list of specific fields to include in the response. Defaults to all fields. <br>Note: If selectFields is provided, excludeFields will be ignored.

excludeFields

query

string

No

Comma-separated list of fields to exclude from the response. Defaults to all fields.

populateOptions

query

string

No

A JSON object that specifies how to include related data in query results.

Responses

Status

Description

200

User retrieved successfully.

PATCH /v1/users/{id}

Update an existing user

Parameters

Name

In

Type

Required

Description

id

path

string

Yes

The userId field

Request body (required)

User details to update

Field

Type

Required

Description

firstName

string

No

User's first name

lastName

string

No

User's last name

preferredBranding

string

No

User's preferred branding theme identifier

preferredLanguage

string (enum)

No

User's preferred language for the application UI and localized content

role

string (enum)

Yes

User's role in the system

brand

array<string>

No

List of brand IDs the user belongs to. Must be empty for admin role, at least one for other roles

stores

array<string>

No

List of store IDs the user belongs to. Must be empty for admin and brand admin roles, at least one for other roles

merchants

array<string>

No

List of merchant IDs the user belongs to. Must be empty for admin and brand admin roles, at least one for other roles

permissions

array<string>

No

List of permission IDs (MongoDB ObjectIds) assigned to the user

Responses

Status

Description

200

User updated successfully

400

Invalid input

401

Invalid token

404

User not found

DELETE /v1/users/{id}

Remove a user from the system

Parameters

Name

In

Type

Required

Description

id

path

string

Yes

the userId field

Responses

Status

Description

204

User deleted successfully