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 |
|---|---|---|---|---|
| query |
| Yes | Maximum number of records to return. Starts from 1 to 1000. |
| query |
| Yes | Page number to retrieve, starting from 0. |
| query |
| 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. |
| query |
| No | Comma-separated list of fields to exclude from the response. Defaults to all fields. |
| query |
| No | JSON object representing filter criteria in MongoDB Query Language (MQL) format. |
| query |
| No | JSON object representing sort criteria in MongoDB Query Language (MQL) format. |
| query |
| No | A JSON object that specifies how to include related data in query results. |
Responses
Status | Description |
|---|---|
| Successfully retrieved a paginated list of users. |
POST /v1/users
Create a new user account
Request body (required)
User details
Field | Type | Required | Description |
|---|---|---|---|
|
| Yes | User's email address |
|
| Yes | User's first name |
|
| Yes | User's last name |
|
| No | User's preferred branding theme identifier |
|
| No | User's preferred language for the application UI and localized content |
|
| Yes | User's role in the system |
|
| No | List of brand IDs the user belongs to. Must be empty for admin role, at least one for other roles |
|
| No | List of store IDs the user belongs to. Must be empty for admin and brand admin roles, at least one for other roles |
|
| 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 |
|---|---|
| User account created successfully |
| Invalid input |
| Invalid token |
| 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 |
|---|---|---|---|
|
| Yes | User's current password |
|
| Yes | New password (minimum 8 characters) |
|
| Yes | Confirmation of new password (must match newPassword) |
Responses
Status | Description |
|---|---|
| Password changed successfully |
| Bad Request - Validation error |
| Unauthorized - Invalid or missing token |
200 response schema
Field | Type | Required | Description |
|---|---|---|---|
|
| No | |
|
| No | |
|
| No |
GET /v1/users/{id}
Get a specific user by ID
Parameters
Name | In | Type | Required | Description |
|---|---|---|---|---|
| path |
| Yes | The userId field |
| query |
| 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. |
| query |
| No | Comma-separated list of fields to exclude from the response. Defaults to all fields. |
| query |
| No | A JSON object that specifies how to include related data in query results. |
Responses
Status | Description |
|---|---|
| User retrieved successfully. |
PATCH /v1/users/{id}
Update an existing user
Parameters
Name | In | Type | Required | Description |
|---|---|---|---|---|
| path |
| Yes | The userId field |
Request body (required)
User details to update
Field | Type | Required | Description |
|---|---|---|---|
|
| No | User's first name |
|
| No | User's last name |
|
| No | User's preferred branding theme identifier |
|
| No | User's preferred language for the application UI and localized content |
|
| Yes | User's role in the system |
|
| No | List of brand IDs the user belongs to. Must be empty for admin role, at least one for other roles |
|
| No | List of store IDs the user belongs to. Must be empty for admin and brand admin roles, at least one for other roles |
|
| No | List of merchant IDs the user belongs to. Must be empty for admin and brand admin roles, at least one for other roles |
|
| No | List of permission IDs (MongoDB ObjectIds) assigned to the user |
Responses
Status | Description |
|---|---|
| User updated successfully |
| Invalid input |
| Invalid token |
| User not found |
DELETE /v1/users/{id}
Remove a user from the system
Parameters
Name | In | Type | Required | Description |
|---|---|---|---|---|
| path |
| Yes | the userId field |
Responses
Status | Description |
|---|---|
| User deleted successfully |