Skip to main content

Get All Users

Retrieve a list of all users in the system.
curl -X GET https://cemac-api.vercel.app/auth/users \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"
Authentication: Required (Bearer Token) Method: GET Endpoint: /auth/users

Response

success
boolean
Indicates if the request was successful
users
array
Array of user objects

Create User

Register a new user in the system.
curl -X POST https://cemac-api.vercel.app/auth/register \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "SecurePassword123",
    "firstName": "John",
    "lastName": "Doe",
    "role": "user"
  }'
Authentication: Required (Bearer Token) Method: POST Endpoint: /auth/register

Request Body

email
string
required
User’s email address
password
string
required
User’s password (minimum 8 characters)
firstName
string
required
User’s first name
lastName
string
required
User’s last name
role
string
required
User role (e.g., “admin”, “user”)

Response

success
boolean
Indicates if the user was created successfully
user
object
Created user object
message
string
Success message

Update User Status

Update the active status of a user.
curl -X PUT https://cemac-api.vercel.app/auth/users/USER_ID/status \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "isActive": true
  }'
Authentication: Required (Bearer Token) Method: PUT Endpoint: /auth/users/{userId}/status

Path Parameters

userId
string
required
Unique identifier of the user

Request Body

isActive
boolean
required
New active status for the user

Response

success
boolean
Indicates if the status was updated successfully
user
object
Updated user object

Update User Role

Update the role of a user.
curl -X PUT https://cemac-api.vercel.app/auth/users/USER_ID/role \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "role": "admin"
  }'
Authentication: Required (Bearer Token) Method: PUT Endpoint: /auth/users/{userId}/role

Path Parameters

userId
string
required
Unique identifier of the user

Request Body

role
string
required
New role for the user (e.g., “admin”, “user”)

Response

success
boolean
Indicates if the role was updated successfully
user
object
Updated user object

Update User Profile

Update user profile information.
curl -X PUT https://cemac-api.vercel.app/auth/users/USER_ID/profile \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "John",
    "lastName": "Smith",
    "email": "[email protected]"
  }'
Authentication: Required (Bearer Token) Method: PUT Endpoint: /auth/users/{userId}/profile

Path Parameters

userId
string
required
Unique identifier of the user

Request Body

firstName
string
Updated first name
lastName
string
Updated last name
email
string
Updated email address

Response

success
boolean
Indicates if the profile was updated successfully
user
object
Updated user object

Build docs developers (and LLMs) love