Create new user (administrators only)
POST/truckers/users/
Allows an administrator to create a new carrier user in the system.
Requirements:
- The user making the request must have an administrator role
- Valid and unique email in the system
- Name is mandatory
Process:
- The user is created with the provided data
- A random password is generated if not specified
- An email with the credentials is sent to the new user
Request Example:
{
email: nuevo@transportista.com,
name: Carlos,
lastname: Ruiz,
phone: +34666555444
}
Request
Responses
- 200
- 400
- 401
- 406
User created successfully. Returns the data of the new user including unique ID.
Invalid data - Required fields were not provided or did not pass validations
Unauthorized - Invalid JWT token or user does not have administrator permissions
User already exists - The provided email is already registered in the system.