UserDto (Response)
The User object returned by the API contains the following fields:Unique identifier for the userExample:
0f4df2de-fffb-4a24-9891-381ecf4f0f87Unique username for the user accountExample:
jdoeEmail address of the userExample:
jdoe@example.comUser’s first nameExample:
JohnUser’s last nameExample:
DoeWhether the user account is activeExample:
trueTimestamp when the user was createdExample:
2024-01-15T10:30:00Timestamp when the user was last updatedExample:
2024-01-15T10:30:00Example Response
RegisterUserDto (Request)
Payload for registering a new user viaPOST /api/users:
Unique username for the new userValidation:
- Required (cannot be blank)
- Length: 3-50 characters
jdoeEmail address for the new userValidation:
- Required (cannot be blank)
- Must be a valid email format
jdoe@example.comUser’s first nameValidation:
- Required (cannot be blank)
- Maximum length: 100 characters
JohnUser’s last nameValidation:
- Required (cannot be blank)
- Maximum length: 100 characters
DoeRole to assign to the new userValidation:
- Required (cannot be null)
- Must be one of:
ADMIN,USER,GUEST
USERExample Request
EditUserDto (Request)
Payload for updating an existing user viaPUT /api/users/{id}:
The
username field is immutable after user creation and cannot be updated.Updated email address for the userValidation:
- Required (cannot be blank)
- Must be a valid email format
jdoe@example.comUpdated first nameValidation:
- Required (cannot be blank)
- Maximum length: 100 characters
JohnUpdated last nameValidation:
- Required (cannot be blank)
- Maximum length: 100 characters
DoeUpdated role for the userValidation:
- Required (cannot be null)
- Must be one of:
ADMIN,USER,GUEST
USERWhether the user account should be activeExample:
true