Users

User management operations

Get current user

get
/users/current

Retrieves the currently authenticated user's information.

Authorizations
Responses
200

Current user's information.

application/json
get
/users/current
GET /api/v1/users/current HTTP/1.1
Host: localhost:3000
Accept: */*
{
  "_id": "text",
  "email": "[email protected]",
  "role": "retailer",
  "verified": true,
  "createdAt": "2025-10-21T06:01:19.734Z",
  "updatedAt": "2025-10-21T06:01:19.734Z"
}

Update current user

put
/users/current

Updates the currently authenticated user's information.

Authorizations
Body
emailstring · emailOptional

User's new email address.

passwordstring · passwordOptional

User's new password (at least 6 characters).

Responses
200

User updated successfully.

No content

put
/users/current
PUT /api/v1/users/current HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Accept: */*
Content-Length: 48

{
  "email": "[email protected]",
  "password": "password"
}

No content

Delete current user

delete
/users/current

Deletes the currently authenticated user's account.

Authorizations
Responses
200

User deleted successfully.

No content

delete
/users/current
DELETE /api/v1/users/current HTTP/1.1
Host: localhost:3000
Accept: */*

No content

Get all users

get
/users

Retrieves a list of all users (admin only).

Authorizations
Query parameters
limitintegerOptional

The number of users to return.

Default: 10
offsetintegerOptional

The number of users to skip.

Default: 0
Responses
200

A list of users.

application/json
get
/users
GET /api/v1/users HTTP/1.1
Host: localhost:3000
Accept: */*
[
  {
    "_id": "text",
    "email": "[email protected]",
    "role": "retailer",
    "verified": true,
    "createdAt": "2025-10-21T06:01:19.734Z",
    "updatedAt": "2025-10-21T06:01:19.734Z"
  }
]

Get user by ID

get
/users/{userId}

Retrieves a user by their ID (admin only).

Authorizations
Path parameters
userIdstringRequired

The ID of the user to retrieve.

Responses
200

The user's information.

application/json
get
/users/{userId}
GET /api/v1/users/{userId} HTTP/1.1
Host: localhost:3000
Accept: */*
{
  "_id": "text",
  "email": "[email protected]",
  "role": "retailer",
  "verified": true,
  "createdAt": "2025-10-21T06:01:19.734Z",
  "updatedAt": "2025-10-21T06:01:19.734Z"
}

Delete user by ID

delete
/users/{userId}

Deletes a user by their ID (admin only).

Authorizations
Path parameters
userIdstringRequired

The ID of the user to delete.

Responses
200

User deleted successfully.

No content

delete
/users/{userId}
DELETE /api/v1/users/{userId} HTTP/1.1
Host: localhost:3000
Accept: */*

No content