Skip to main content
POST
/
api
/
users
Create User
curl --request POST \
  --url https://api.example.com/api/users \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "<string>",
  "password": "<string>",
  "role": "<string>",
  "firstName": "<string>",
  "lastName": "<string>",
  "phone": "<string>",
  "address": "<string>",
  "supervisorId": "<string>"
}
'
{
  "id": "<string>",
  "email": "<string>",
  "role": "<string>",
  "firstName": "<string>",
  "lastName": "<string>",
  "isActive": true,
  "createdAt": "<string>"
}
Create a new system user. Admin and Supervisor roles can create users.

Authentication

Required. Only Admin and Supervisor roles can create users.

Request Body

email
string
required
User’s email address (must be unique)
password
string
required
User’s password (minimum 8 characters)
role
string
required
User role: ADMIN, SUPERVISOR, or CREDIT_OFFICER
firstName
string
required
User’s first name
lastName
string
required
User’s last name
phone
string
Contact phone number
address
string
Physical address
supervisorId
string
Supervisor ID (required when creating CREDIT_OFFICER)

Response

id
string
Unique user identifier
email
string
User’s email address
role
string
Assigned role
firstName
string
User’s first name
lastName
string
User’s last name
isActive
boolean
Account status (true by default)
createdAt
string
ISO timestamp of creation

Example Request

cURL
curl -X POST "https://api.millenium-potters.com/api/users" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "SecurePass123",
    "role": "CREDIT_OFFICER",
    "firstName": "Jane",
    "lastName": "Smith",
    "phone": "+234-800-1234",
    "supervisorId": "clx456def"
  }'

Example Response

{
  "id": "clx789ghi",
  "email": "[email protected]",
  "role": "CREDIT_OFFICER",
  "firstName": "Jane",
  "lastName": "Smith",
  "isActive": true,
  "createdAt": "2026-03-11T10:30:00Z"
}

Error Responses

Missing or invalid authentication token.
User does not have permission to create users.
Invalid request body. Common issues:
  • Email already exists
  • Password too short
  • Invalid role value
  • Missing supervisorId for Credit Officer
Credit Officers must be assigned to a Supervisor. The supervisorId field is required when creating a user with CREDIT_OFFICER role.

Build docs developers (and LLMs) love